0

HI I have a aspx page with a link . If i click that link i want the page to be redirected to another aspx page and execute the java script in it .. ...

plz some one help ... ..

1 Answer 1

2

This code below will redirect your page to another one :

<a href="anotherpage.aspx">Redirect</a>

and then after redirection occurs , use this technique :

<head>
   <script type="text/javascript">
      function init()
      {
         alert("Hello world");
      }
   </script>
</head>

<body onload="init()">
...
</body>

By the way, your question and its title don't match. I answered by your question.

Edit :

Since you look like a beginner, I would like to give you some more information about that :

onload event could seem cool but not as much cool as jQuery's ready method. Because html onload event will wait till every thing on the page is loaded but jQuery won't wait everything to be loaded. When DOM is ready, your code will be fired meanwhile the pictures and stuff may be still loading.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.