| | |
passing parameters to a page
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2004
Posts: 2,108
Reputation:
Solved Threads: 18
I have a javscript function which opens a url....The only thing is I need it to open pages with parameters, and I'm not sure how to do it:
If you can point me in the right direction or help me out in any way, I would really appreciate it.
<html>
<head>
<title>LinkOpener</title>
<script language="JavaScript">
<!--
function SearchTest(url, args)
{
// if args is null, do the following
window.open(url,'win1','width=600,height=700, status, toolbar, menubar, scrollbars, resizable')
// else
// implement your code
}
// -->
</script>
<body>
<h3>Search Test:</h3>
<a href="#wf" onClick="JavaScript:SearchTest('http://www.msn.com','')">GET request</a>
<br>
<a href="#wf" onClick="JavaScript:SearchTest('http://www.ntis.gov/search/results.asp?loc=3-0-0&search=','frm_qry_Category=ALL&frm_qry_Search=earth&frm_qry_Search=AND&frm_qry_Search=&frm_qry_Search=AND&frm_qry_Search=&frm_qry_Year=1990&frm_qry_MaxRec=100&frm_qry_Rank=1')">POST request</a>
</body>
</html>If you can point me in the right direction or help me out in any way, I would really appreciate it.
•
•
Join Date: Jun 2004
Posts: 2,108
Reputation:
Solved Threads: 18
•
•
•
•
Originally Posted by tgreer
Simply concatentate URL and ARGs. In fact, you don't even need a separate variable and/or call for "args". They are simply part of the URL.
•
•
Join Date: Dec 2004
Posts: 1,655
Reputation:
Solved Threads: 35
Well, you can only POST a message using a POST query. Any parameters passed via a URL, create a GET query.
Now, you could use JavaScript, to create a form, a lot of invisible variables, populate those variables, then call the form's "submit()" method, which will POST the form. You can only do that on a page you "own", of course.
"AJAX" is a funny little beast - it refers to scripting the XMLHttpRequest object. It doesn't do a POST, it fires off another request, "behind the scenes", so that the user doesn't see any page refresh.
Now, you could use JavaScript, to create a form, a lot of invisible variables, populate those variables, then call the form's "submit()" method, which will POST the form. You can only do that on a page you "own", of course.
"AJAX" is a funny little beast - it refers to scripting the XMLHttpRequest object. It doesn't do a POST, it fires off another request, "behind the scenes", so that the user doesn't see any page refresh.
•
•
Join Date: Jun 2004
Posts: 2,108
Reputation:
Solved Threads: 18
•
•
•
•
Originally Posted by tgreer
Well, you can only POST a message using a POST query. Any parameters passed via a URL, create a GET query.
Now, you could use JavaScript, to create a form, a lot of invisible variables, populate those variables, then call the form's "submit()" method, which will POST the form. You can only do that on a page you "own", of course.
"AJAX" is a funny little beast - it refers to scripting the XMLHttpRequest object. It doesn't do a POST, it fires off another request, "behind the scenes", so that the user doesn't see any page refresh.
![]() |
Similar Threads
- Passing data from forms from one page to another (JavaScript / DHTML / AJAX)
- passing parameters in bat file (Visual Basic 4 / 5 / 6)
- Junior Developer have some doubts in CF_SQL_NUMERIC (ColdFusion)
- Passing Variables/Parameters - By Ref/Value? (Computer Science)
- ASP, Java and XML-RPC (ASP)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Having trouble running javascript
- Next Thread: JavaScript reference website or download
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
ajax ajaxcode ajaxexample ajaxjspservlets api blackjack browser bug calendar captchaformproblem checkbox child class close cookies createrange() cursor date debugger dependent developer disablefirebug dom dropdown editor element embed engine events explorer ext file firehose flash form forms game getselection google gxt hiddenvalue highlightedword hint html ie7 ie8 iframe image() images internet java javascript javascripthelp2020 jquery jsf jsfile jump libcurl math matrixcaptcha media object onerror onmouseoutdivproblem onreadystatechange parent paypal pdf php position post programming progressbar rated regex runtime safari scriptlets scroll search security session shopping size software sql star stars stretch synchronous text textarea tweet unicode web webservice window windowsxp wysiwyg \n






