Could use some help with a href link in IOS

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Could use some help with a href link in IOS

Post by FireWorx » Sat Feb 25, 2012 5:07 am

Hi,
I would like to load an HTML page and execute a little javascript to scroll down to a predefined point on the page where an HTML anchor tag has been placed on the page. Think a scrolling list of 100 dates and I want the page to load and scroll down 30 dates to the current date. It works on my local html page. as shown below

<html>
<body onload="goToAnchor();">
<script type="text/javascript">
function goToAnchor() {
location.href = "file://localhost/Users/fireworxsoftware/Desktop/untitled%20folder/MyHtml.html#myAnchor";
}
</script>
------------------- Then I insert
<a name="myAnchor"></a> ------anywhere in the html at the point I want the page to scroll to on open.

HOWEVER when I load it into the iOS browser using the link below does not execute the JS properly

<html>
<body onload="goToAnchor();">
<script type="text/javascript">
function goToAnchor() {
location.href = "file://specialFolderPath("Documents")My.html#myAnchor";
}
</script>
Attachments
DataViewcopy3.html.zip
(640 Bytes) Downloaded 203 times

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: Could use some help with a href link in IOS

Post by FireWorx » Sat Feb 25, 2012 8:27 am

Well it appears that the href link is good. The page loads and no error message is sent but the javascript function won't execute. Perhaps that is just the way it goes. If anyone has found away to get this done please let me know.
Thanks,
Dave

Post Reply