Solved

Send args using window.open()

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SharePoint 2013 Blog Template 2 37
Show confirmation alert in Jquery 14 47
Angular.js example vocabulary extensions 5 35
how can i extend ? 2 22
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

861 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

24 Experts available now in Live!

Get 1:1 Help Now