SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Appearing in frame

    Ive got this code that shows a custom alert script when clicking on a link and its currently in an iframe, how can i make it appear in the frame named chat instead of the current frame it is in

    Code:
    <script>
    
    document.onclick=disableEvents
    document.oncontextmenu=disableEvents
    
    var ef=0
    
    function showalert()
    {
    
    ef=1
    var ids
    ids=document.getElementById('alert')
    ids.style.left=300;
    ids.style.top=150;
    ids.style.visibility="visible"
    }
    
    function disableEvents()
    {
    if(ef)
    return false;
    }
    </script>
    
    
    <body>
    
    
    <div align=center id="alert" style="position:absolute;left:0;top:0;border: 2px solid gray; width:100; height:100;color:red; background-color:black;visibility:hidden;">
    
    <br>Alert Message <br><br><br>
    
    <input type=button name=ok value=0k onclick="ef=0;document.getElementById('alert').style.visibility='hidden';" >
    
    </div>
    
    <br><br><br>
    consider there is some error you want show when this link is clicked
    <a href="javascript: showalert();">click here</a>
    
    </body>
    Animated Chatrooms - www.121chatrooms.net

  2. #2
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is a code i tried, but it loads an error 404 and it dosnt load in the chatframe.

    <a href=\"#\" onclick=\"parent.chatframe.document.getElementByID('chatframe').showalert(); return false;\">
    test</a>
    Animated Chatrooms - www.121chatrooms.net

  3. #3
    SitePoint Guru
    Join Date
    Sep 2007
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or is there another script simular? Ive looked pretty much everywhere
    Animated Chatrooms - www.121chatrooms.net


Bookmarks

Posting Permissions

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