change variable via browser

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kuba

    change variable via browser

    hello

    i've problem.

    here is sample code:

    <SCRIPT LANGUAGE="JavaS cript">
    <!--
    //var city = NewYork;

    function check(form,city )
    {
    blabla
    }

    is that possible to change this variable (city) to other ?
    i've no access to target page and i need to execute this code on this page
    with another variable


  • Ivo

    #2
    Re: change variable via browser

    "kuba" wrote[color=blue]
    > i've problem.
    >
    > here is sample code:
    >
    > <SCRIPT LANGUAGE="JavaS cript">
    > <!--
    > //var city = NewYork;
    >
    > function check(form,city )
    > {
    > blabla
    > }
    >
    > is that possible to change this variable (city) to other ?
    > i've no access to target page and i need to execute this code on this page
    > with another variable[/color]

    If you type in the addressbar:

    javascript:var city="London"; void("");

    the variable will be changed. The void() thing is necessary bacause this
    code will return a value (the value of the assignment) and we must prevent
    the browser from "navigating " to display this return value as that would
    mean we leave the page.
    If you type

    javascript:chec k(form,"London" ); void("");

    the function will run on your command, not because of an event in the page.
    HTH
    Ivo


    Comment

    Working...