Results 1 to 7 of 7

Thread: Disable execution of JS file

  1. #1
    Join Date
    Mar 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Disable execution of JS file

    Hello. I have a html file, that inside the html file I have only a document.write("<iframe src=http://....></iframe>");. This frame loads a lots of JS files. Is it possible to add some code to my html page to prevent viewing some of the JS files or disable it. I hope you can understand me. Thanks in advance

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    There's been quite a few "can I disable JavaScript" questions lately, and the answer is no, you can't. The best you can do is use noscript tags.
    - Mike

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If you have some control over or connection to the page in the iframe, many things are possible. However, if it is on another domain and you have no access to that server, there isn't much that can be done. A server side script on your server may be able to serve the content of the page and then, you could do a lot with it before serving it through your iframe. This requires that your server is set up to do this and has nothing to do with javascript itself.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Mar 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    This is the JS code:

    Code:
    <Script>
    var imgUrl,color,encode,tz,dst;
    color="7fc31c";
    encode="en";
    imgUrl = "http://www.ultrascores.com/ultrascores.gif";
    tz = "&#37;2b0200";
    dst="1";
    document.write("<center><iframe src=http://free.7m.cn:10004/live_default.aspx?site=9533&Cr=" + color + "&encode=" + encode + "&img=" + imgUrl + " height=100% width=800></iframe></center>");
    </Script>
    Basiclly this is my URL -
    Code:
    http://free.7m.cn:10004/live_default.aspx?skin=&img=http://www.ultrascores.com/ultrascores.gif&encode=en&site=9533&Rst=&Cr=7fc31c&Sl=&match=&tz=0000&dst=
    I want to remove left Menu, and top horizontal menu. I think that they are defined in a single .JS file. Is that possible? Or to get only the Livescore service which is in XML format? Thank you very much and excuse my English.
    Last edited by rado84; 03-13-2007 at 12:02 PM.

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    The only way I can think of in that situation would be to use PHP or some other server side language to fetch the contents of the page to a local page. If that works, the external style and scripts from the page that are not coded with absolute URLs will stop working and the content as well as its remaining scripts and style could be massaged with either javascript or the server side language to format and present it as desired, including selective external scripts and/or stylesheets that were disabled (if any). However, this would likely be no simple task, if it could be done at all. I also suspect that it would be a violation of the terms of use of the remote resource. If that is the case, we aren't allowed to assist you further.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Mar 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hello and thanks again for the reply jscheuer1. I don't think this will be violation of terms, because I have talked with their webmaster and he told me if I can use the info from the site that couldn't be problem or if I want to give them money to redesing it for me. But their fees are very high and that's why I search for solution here at master coders. Jscheuer1 I am not a programmer, but from your reply I understand allmost everything. Please can you tell me where to search the basics for this PHP script or tell me basiclly what I need to do and after that I will try do finish bymyself. Thank you again.

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Since what you are seeking is a way to obtain for free that which is generally offered for a fee, it is a violation of the site owner's copyright. Even if the owner invites you to try, that doesn't change that fact for me as, I've had no communication with them, so cannot know for sure what was meant by that.

    It might be as simple as, "You can try it if you like but, you can't do it. We sell that service if you are really interested."

    Anyways, I am off the hook as I really don't know enough about server side code to do more than get you started. The first step of many would be to determine if your server has PHP or some other server side language available to you and, if it does, if the permissions for it are such that would allow the importation of an external page to a local one.

    As far as that first part goes, this thread:

    http://www.dynamicdrive.com/forums/s...ad.php?t=16567

    on fetching a title from a remote page includes all that is required to fetch content via PHP if available and if the permissions on your server allow it.

    If you can get that working with - say, Google being the the external page you are fetching, that will mean step one is possible.

    As far as other server side languages like asp, jasp, etc., I have no clue how to even begin.

    Finally, the likely complexity of getting this all to work, if it even can be done with this particular link, is way beyond the usual level of help rendered here in these forums. I for one don't have the time for it now and will not for at least a month or longer.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

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
  •