Call a user defined javascript function url

May 28, 2010 at 14:07:34
Specs: Windows 7, Mac, Windows 98, WinXP, Ubuntu, etc.,...

Say I have an html page as the following:
<html>
<head>
<script>
        function test() {
                alert("Test");
        }
</script>
</head></html>

How would I go about to access that function
through the url? Something like these (these
don't work):

test.html?test
or
test.html#test


See More: Call a user defined javascript function url

Report •


#1
May 30, 2010 at 11:41:03

You might try something like

if(document.location.search == '?test') {

   test();
}


HTH

Report •
Related Solutions


Ask Question