Dear Drupal Friends

I need to make a jquery script to show a picture with lightbox2 for those who come from my www.creo4u.it alias to my www.walterfantauzzi.com web site.

I've try this code but not work good

$(document).ready(function(){
/* if(windows.location.href == 'www.creo4u.it'){
$.lightbox('http://www.walterfantauzzi.com/files/prova.jpg')};*/
$("#nav a").html(" ");
});

SomeOne can help me please?

thanks

Comments

mm167’s picture

if u have only 1 window, try

window.location.href instead of windows.location.href

ryosaeba’s picture

dear mm167,

Yes I've only windows... you can try to see here http://www.creo4u.it

I've try to change the code like this:

$(document).ready(function(){
/* if(window.location.href == 'www.creo4u.it'){
$.lightbox('http://www.walterfantauzzi.com/files/prova.jpg')};*/
$("#nav a").html(" ");
});

But It not work...

I've put this code in a block on footer (it's right?), now I see that my provider not make alias but redirect from www.creo4u.it to www.walterfantauzzi.com

In this case, how can I do? :(

mm167’s picture

sorry, location.href is the current url, no the previous url.

the previous is document.referrer.
but, this field is optional. so, u may need to add this in your site.

ryosaeba’s picture

It not work too...

MMmmm Now I've try to make a page http://www.walterfantauzzi.com/creo4u and I've redirect my www.creo4u.it to it!

Now Can I put inline javascript code into this page?

what do you think about this way?