Web Analytics Made Easy -
StatCounter Very Very Strange Popup Problem - CodingForum

Announcement

Collapse
No announcement yet.

Very Very Strange Popup Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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; Oct 16, 2006, 07:52 AM.

    Comment


    • #3


      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

      Comment


      • #4
        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?

        Comment

        Working...
        X