Solved

Send args using window.open()

Posted on 2014-01-26
1
184 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 82

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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 …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now