...

View Full Version : Very Very Strange Popup Problem



RonnyZenn
10-16-2006, 12:30 PM
Hi,

I have a strange pop-up problem. First let me display the code,


function addLink(){
document.getElementById('TESTME').innerHTML= "<br><span id=me><a href=# onclick=\"window.open('http://www.yahoo.com','name','height=255,width=250,toolbar=no,directories=no,status=no,menubar=no,scrollbar s=no,resizable=no')\">TEST LINK</a></span>";
}


This code works perfect in an empty page with <div id="TESTME">...</div>

But when I copy/paste the same code in to actual site of mine(without changing even a bit), it doesn't work at all.

I mean in my actual site, I get the link and everything setted up as I wanted but it doesn't open a pop-up.When I change it to an ordinary link with <a href=.. target=_blank>.... </a>, It again works fine.

But I want just an ordinary pop-up to be displayed which I couldn't do.:confused:

Any idea or suggestion!!!?

Thanks

Kirl
10-16-2006, 12:48 PM
I think this might be the problem, you should use differing ' ' or " " when they're inside of eachother. Now you're closing the line with the second ", use ' instead.

Pretty poor explanation, but I hope it was at least somewhat understandable... :)


I have also sometimes experienced differences between on and offline, how that is possible is beyond me. Meaby somebody else can explain this?

RonnyZenn
10-16-2006, 12:55 PM
original code

document.getElementById('TESTME').innerHTML= "<br><span id=me><a href=# onclick=\"window.open('http://www.yahoo.com','name','height=255,width=250,toolbar=no,directories=no,status=no,menubar=no,scrollbar s=no,resizable=no')\">TEST LINK</a></span>";

and as you said I replaces " with ' and this came out


document.getElementById('TESTME').innerHTML= "<br><span id=me><a href=# onclick='window.open('http://www.yahoo.com','name','height=255,width=250,toolbar=no,directories=no,status=no,menubar=no,scrollbar s=no,resizable=no');'>TEST LINK</a></span>";

Poorly this doesn't work also :(

RonnyZenn
10-16-2006, 03:23 PM
here is a funny thing, I figured out just now, the page is a PHP file, but mostly contains HTML codes in it, just in 2 places there are PHP script written(one print one session), when I remove these PHP lines,pop-up script works fine but what is the real problem? why can I use simple pop-up script when there is couple lines of PHP?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum