0

I have a Javascript file (which will start when invoked from my application when the user selects an item in my application).
In that file I have a variable and am storing a large, dynamic string (based on the user selection) in that variable.

Now I want to open a new page from the Javascript and display the value stored in the string variable in that page.

How do I pass the variable value and display it in that page?

I can use window.open() to open a new window.

4

1 に答える 1

0

ステップ1

以下のように新しいウィンドウを開きます

newWindow = window.open('newpage.html',/* other parameters */);

ステップ2

新しいウィンドウに関数を書く

function passValue(val){
// do stuff
}

Step3

ウィンドウが開いたら、関数を呼び出して以下のような値を渡します

newWindow.passValue('your value')

あなたは終わった.. !!

乾杯

于 2013-02-18T05:34:49.700 に答える