Solved

Send args using window.open()

Posted on 2014-01-26
1
188 Views
Last Modified: 2014-01-26
Hi Experts,

I want to do this window.open('myPage.aspx?arg1=abc') but it does not work if I send the page only it will open but when I send a arg it does not. How do I send the arg.
0
Comment
Question by:DColin
1 Comment
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39810351
You must have something else going on.  I made up this simple demo pages and they work fine with args attached.
Window Open Test Page 1 - save as 'wopenpg1.html'
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Window Open Test</title>
<script type="text/javascript">
<!--
function nxtpg() {
window.open('wopenpg2.html?arg1=abc');
}
// -->
</script>
</head>
<body>
<h1>Window Open Test Page 1</h1>
<button type="button" name="test" value="Test" onclick="nxtpg()">Test</button>
</body>
</html>

Open in new window

Window Open Test Page 2 - save as 'wopenpg2.html'
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Window Open Test</title>
<script type="text/javascript">
<!--
function nxtpg() {
window.open('wopenpg1.html?arg1=abc');
}
// -->
</script>
</head>
<body>
<h1>Window Open Test Page 2</h1>
<button type="button" name="test" value="Test" onclick="nxtpg()">Test</button>
</body>
</html>

Open in new window

0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question