www.webdeveloper.com
Results 1 to 2 of 2

Thread: Using window.location to Display Content

  1. #1
    Join Date
    Oct 2008
    Posts
    4

    Question Using window.location to Display Content

    Hey guys.
    I'm currently paying for a web service on a hosted platform. Basically, I'm unable to edit any raw content, however I am able to do things like add JS/HTML to the header or footer of a page, which will in turn be displayed on every page of this platform. My dilemma is, I only want content being showed on a single page of the platform. Specifically, I want a window.alert being displayed on the "/signup" page, but all I have to work with is JS in a global footer.

    Is there some way I can use window.location to achieve this?

  2. #2
    Join Date
    Dec 2003
    Location
    Bucharest, ROMANIA
    Posts
    15,428
    Yes, on using a RegExp match():
    Code:
    if(location.href.match(/signup/)){
    alert('this is the sign up page!');
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles