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.
Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    New Coder
    Join Date
    Jan 2004
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Kill Javascript using Javascript

    is it possible to kill/bypass a javascript using another one?

    i.e. main.html has a javascript that disables right click.

    we use main.html in index.html with <iframe> tags.

    can we write a such script in index.html,to enable right click again?

  • #2
    Master Coder
    Join Date
    Feb 2003
    Location
    Umeå, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Yes, you can overwrite the right click killing. You need to find the window that has it (using the parent keyword), and set the following properties to function (){return true;}:
    - window.onclick
    - window.oncontextmenu
    - document.oncontextmenu
    If that doesn't do it, try to kill them on each DOM element for which the onclick and oncontextmenu properties aren't null or undefined.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #3
    New Coder
    Join Date
    Jan 2004
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i couldnt do or i didnt understand (because of my English i think)

    could you post the codes please?

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here is a simple solution:
    do not disable right click (since there is no reason for doing so) and you would not need to worry about enabling it again.
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #5
    Regular Coder
    Join Date
    Dec 2003
    Location
    USA
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Vladdy
    Here is a simple solution:
    do not disable right click (since there is no reason for doing so) and you would not need to worry about enabling it again.
    I'm with Vladdy here.

  • #6
    New Coder
    Join Date
    Jan 2004
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok,main.html is in another server,i dont have write permission to it. So i have to disable it from index.html

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can not script between domains PERIOD
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #8
    Regular Coder
    Join Date
    Jul 2003
    Location
    Massachusetts
    Posts
    472
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #9
    New Coder
    Join Date
    Jan 2004
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Vladdy
    Can not script between domains PERIOD
    yes youre right thank you.
    but if i use

    <?php
    PHP Code:
    include ("http://blabla/main.html"
    ?>
    instead of using iframe, index.html will contain the whole source ode of main.html.

  • #10
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    I don't know php but as in other server-side languages, you can't include files from other domains. In ASP, there are built-in components as well as third-party components that can grab information from other web page but I don't know if it's also possible with php.

  • #11
    New Coder
    Join Date
    Jan 2004
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes it works.

    http://freepgs.com/mesbaba8/index.php (please take a look)

    is


    <?php
    include("http://www.indirmax.com/default.asp");
    ?>

    and right-click doesnt work.

    i need a script to write into index.php

  • #12
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Since you are using php - do it server side:
    read the external file in a variable
    strip all script tags
    then echo this variable in your page
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #13
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,043
    Thanks
    0
    Thanked 251 Times in 247 Posts
    I was shocked php allows server-side includes like that.
    You can easily make other pages your "own" page without even using a server component or something.

    Reading an external file in a variable requires the file system object of php or an http component not using includes. But I don't think php file system support accessing files from other domains, or from http protocol for that matter.

  • #14
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #15
    New Coder
    Join Date
    Jan 2004
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it is done!

    thank you all!

    <?php

    $dosya=fopen("http://www.indirmax.com/default.asp","r");
    while (!feof($dosya))
    {

    $satir=fgets ($dosya,4096);
    $satir=ereg_replace ("false","true",$satir);
    echo $satir;
    }

    ?>


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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