userstack777
userstack777

Reputation: 21

pass vector parameter to popup window

I need pass a vector like parameter to popup window opened by javascript, I mean on this code to pen popup:

window.open("<my_site_url>?vector2popup=" +  js_vector, 'name popup', stile);

js_vector --> javascript is vector I need transfer to popup window

Thanks

Upvotes: 0

Views: 48

Answers (1)

Quentin
Quentin

Reputation: 943209

The only kind of data you can pass in a URL is a (properly encoded) string.

Whatever the value of js_vector is (vector is not a standard JavaScript type and you haven't linked to any library documentation that might explain what you are talking about), you need to convert it to a string first.

JSON.stringify() might help with that.

Alternatively, capture the return value of open, wait for the document to load, then pass the variable via the object returned.

Upvotes: 1

Related Questions