Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaScript Code Help Required

 
V K Gupta
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1 window.onload = function()
2 {
3 var browser=navigator.appName; // browser name
4 var b_version=navigator.appVersion; //browser version
5 var version=parseFloat(b_version); //
6 if(browser == "Microsoft Internet Explorer")
7 {
8 $('registerU').href='/userpackage/index.action'; // What is happening Here
9 $('fogotPass').href='/userpackage/forgetPassword.action'; // What is happening Here
10 }
11 }

Please explain me what does Line no 8 and 9 do.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sets the href for two links on the page.

Eric
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It might help if you let us know which library you are using. I'd guess Prototype?

Also, please be sure to take the time to compose descriptive subjects for your posts; read this for more information.

Using a title of "JavaScript Code Help Required" in a forum completely dedicated to questions on JavaScript isn't very helpful.

Please go back and change your post to add a more meaningful subject by clicking the
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic