Satch3000
Satch3000

Reputation: 49384

JQuery Code modification needed

I need to tweek some functionality a bit.

Right now I am using this code in a JS file:

$('body').ready(function() { self.open(); });

I have some links from Page A to page B.

I basically want this popup ONLY to open if it's coming from one of these link on page A

Is that tweek possible please?

Upvotes: 0

Views: 123

Answers (1)

mplungjan
mplungjan

Reputation: 178011

You mean

if (document.referer && document.referer.indexOf('pageA')!=-1) {
  window.open('somelink.html','_blank');
}

Upvotes: 2

Related Questions