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
    Jun 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Javascript Edit page property in modal window

    Hi,

    Can someone help me on this. I am opening a url using a javascript function in a javascript modal popup dialog window. I would like to know if there is a way to edit the property of the page opened in a popup? like I want to hide the banner of the page. is it possible?

    this is a sample script i found in the net:
    TINY.box.show('advanced.html',1,300,150,1,3)

    can we edit the advanced.html page properties?

    Any help would be greatly appreciated. Thanks

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,240
    Thanks
    203
    Thanked 2,554 Times in 2,532 Posts
    Quote Originally Posted by jobertlapena26 View Post
    I want to hide the banner of the page. is it possible?
    Rule 1.4) No illegal requests- Do not post requests that are illegal or break the usage terms of the service in question, such as where to download warez, disable pop up ads on your free host etc.

  • #3
    Banned
    Join Date
    Jul 2009
    Posts
    13
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jobertlapena26 View Post
    this is a sample script i found in the net:
    TINY.box.show('advanced.html',1,300,150,1,3)
    can we edit the advanced.html page properties?
    I do not support 3rd party scripts. And have no idea about "properties". But assuming here and below you have reference to newly open()ed window as w
    Code:
    with (w) {
      // problem 1: get reference(s) to offensive element(s)
      // g*syndication is domain squatters
      el = document.getElementById("partnerlinks");
      // or, more complex
      els = document.getElementsByTagName("DIV");
      // see getElementXXXX() reference for more
    
      // problem 2: use CSS to hide them
      for (var i = 0; i < els.length; i++) {
        // spam is SEO, proper term is trolling :)
        if (els[i].className.toLowerCase() == "newscredit") {
          // using block rules
          els[i].display = "none";
          // or, positioning rules
          els[i].visibility = "hidden";
          // or, banish crap inside them to the null
          els[i].innerHTML = null;
          // see element, node and CSS reference for more 
        }
      }
    }
    This will not work across domains.
    Last edited by bugmenot; 07-12-2009 at 04:39 AM.

  • #4
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,444
    Thanks
    11
    Thanked 598 Times in 578 Posts
    showmodaldialog freezes the parent.
    if you don't control both urls, you won't be able to do this...
    my site (updated 2014/10/20)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.3, IE11:9.2, IE9:2.7, IE10:2.6, FF:16.8, CH:47.5, SF:7.8, NON-MOUSE:37%


  •  

    Posting Permissions

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