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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Apr 2006
    Posts
    311
    Thanks
    17
    Thanked 0 Times in 0 Posts

    Disable JavaScript for frame only?

    Hey All,
    I'm working on a little frames based web market research tool (not for public consumption) which allows us select various supplier websites via a link in a header frame, to be loaded in a main frame, from which we may drag data to be dropped into a form in a third form_frame which then submits to our database. All in all, this works nicely until we come to one of the supplier sites which has implemented a frame-killer script. Hmmm.

    Now, I know it would be bad form (probably illiegal even) to force a site into the frames of another site for public consumption but I don't think that is an issue here so I ask you all ...

    Is it possible to disable JavaScript (on the fly) for a given frame only?

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,253
    Thanks
    203
    Thanked 2,557 Times in 2,535 Posts
    "All in all, this works nicely until we come to one of the supplier sites which has implemented a frame-killer script."

    That's because he doesn't want you to do what you are proposing.

    "Is it possible to disable JavaScript (on the fly) for a given frame only?"
    As far as I know, no, not possible.

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Simplest way to "disable" javascript for a page displayed in a specific frame is to NOT put any Javascript in the page that is to go in that frame or to change the javascript in that page so that it only runs if the page isn't displayed in your frame. As Javascript cannot access pages from a different domain that are displayed in a frame in your page you can't do anything with Javascript unless both the page creating the frame and the page displayed in the frame are both on your site anyway. If you display someone else's page in your frame then any Javascript that they have in that page will run and there is nothing whatever you can do about it unless you can get them to change the code.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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