4 Replies - 1196 Views - Last Post: 26 July 2012 - 03:54 AM

#1 rupareliab  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 20-July 12

how to find the page which is rendered from the url by javascript

Posted 25 July 2012 - 08:15 AM

I am developing a website in asp.net in which i need to remove class to the body tag if the page is index.aspx page. I want to do it by javascript. I am getting the current pathName and applying the following code bt after that it shows 404 page not found error:
if (window.location.pathname = "/SWGT/index.com"){
        $("body").removeClass("normalpage") ;
        }



Is This A Good Question/Topic? 0
  • +

Replies To: how to find the page which is rendered from the url by javascript

#2 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 9162
  • View blog
  • Posts: 33,981
  • Joined: 27-December 08

Re: how to find the page which is rendered from the url by javascript

Posted 25 July 2012 - 02:14 PM

Java != Javascript. Moved to Javascript.
Was This Post Helpful? 0
  • +
  • -

#3 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5723
  • View blog
  • Posts: 22,639
  • Joined: 23-August 08

Re: how to find the page which is rendered from the url by javascript

Posted 25 July 2012 - 05:36 PM

You use == to compare, not =. = ASSIGNS the right side to the variable on the left.
Was This Post Helpful? 0
  • +
  • -

#4 rupareliab  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 20-July 12

Re: how to find the page which is rendered from the url by javascript

Posted 26 July 2012 - 03:32 AM

hello,

in javascript == isn't used for comparion, it uses = for comparison.
Was This Post Helpful? 0
  • +
  • -

#5 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5723
  • View blog
  • Posts: 22,639
  • Joined: 23-August 08

Re: how to find the page which is rendered from the url by javascript

Posted 26 July 2012 - 03:54 AM

Uh, no.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1