I want to display bannerA.js when visitor is on page.html, and display bannerB.js when visitor is on page_en.html and so on with 5 banner/5 page.
I saw i could use some code like this :
if(document.URL.indexOf(“foo_page.html”) >= 0){
…show your message
}
but I’m not sure because I have more than two choices. Maybe switch control can help ?
How can I do this using the same javascript code ?
This is what I’ll do:
page will hold the string you are interested in and then do a switch accordingly.