Could use some help with a href link in IOS
Posted: 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>
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>