Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Very Very Strange Popup Problem

    Hi,

    I have a strange pop-up problem. First let me display the code,
    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.

    Any idea or suggestion!!!?

    Thanks

  • #2
    Regular Coder
    Join Date
    Jan 2006
    Posts
    243
    Thanks
    14
    Thanked 2 Times in 2 Posts
    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?
    Last edited by Kirl; 10-16-2006 at 12:52 PM.

  • #3
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    :(

    original code
    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

    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,scrollbars=no,resizable=no');'>TEST LINK</a></span>";
    Poorly this doesn't work also

  • #4
    New to the CF scene
    Join Date
    Oct 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP causes the problem but why?

    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •