Rajat Sharma Rajat Sharma - 1 year ago 100
CSS Question

Javascript if (window.location.href) adding two urls

Very simple question but can't find the answer. Can you put two url's inside

if (window.location.href

here is mine:

if (window.location.href == 'http://example.example.com/support/default.asp') {

I need to add a second link... so i only want a div to load from that page and one more page.

Answer Source

It should be as simples as

if (window.location.href == 'http://example.example.com/support/default.asp' ||
    window.location.href == 'http://secondurl.com') {

unless I misunderstood the problem.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download