Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
74
rated 0 times [  77] [ 3]  / answers: 1 / hits: 62169  / 14 Years ago, mon, may 17, 2010, 12:00:00

I want to display a certain message on a certain page.



Suppose the name of the page I want to display something on is called foo_page.html,



How can I do this using javascript?


More From » javascript

 Answers
10

You can do it like this:



if(document.URL.indexOf(foo_page.html) >= 0){ 
...show your message
}

[#96765] Thursday, May 13, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tylerdamiena

Total Points: 139
Total Questions: 90
Total Answers: 118

Location: Liechtenstein
Member since Wed, Dec 8, 2021
3 Years ago
;