CGI Parameters (or Equivalent) In Javascript
Jul 20, 2005Does anyone know a way of passing parameters into a Javascript script 'from
outside' via additions to the URL -- similar to (or even the same as!) the
idea of CGI parameters?
Does anyone know a way of passing parameters into a Javascript script 'from
outside' via additions to the URL -- similar to (or even the same as!) the
idea of CGI parameters?
I want to do some Win32 application automation from JavaScript. Is it
possible? Failing that, is there a way to execute an application from
JavaScript?
Whats the Javascript equivalent for PHP's file_get_contents ?
<script type="text/javascript">
document.open("http://anotherpage.php"); // I know this is not the way because this opens a new page
</script>
Any way without using frames ?
I have to do drag and drop.Following one is runing well in IE But not in FireFox. Code:
View 1 Replies View RelatedI'm looking to return DATE ONLY for yesterday's date. No seconds,
milliseconds. Formatted either yyyy/mm/dd or mm/dd/yyyy. VB does it so
easily Date()-1 will return 03/27/2007 if today is 03/28/2007. Why so
many hoops for javascript? Any ideas?
I am using a location in my javascript: '../../myfolder/myfile.asp'
I want to make the script reusable by pages in different folders. The 'myfolder' is in the root of my site. How can I target this from any other folder such as the vbscript server.mappath('myfolder/myfile.asp')?
What is the best way to get just the script name that is running without the path and parameter info? This would be the JavaScript equivalent to the PHP command:
basename ($PHP_SELF);
I have a JavaScript function that receives an Array with words. This
Array can be gotten from a query to a DB using JSP.
The JavaScript function is executed when onFocus event occurs:
<input type='text' onFocus='myFunction(this.event, myArray);' />
myArray is declared as:
<script>
var myArray = new Array('j'habite', 'tu habites', 'il habite');
</script>
I want to tell javascript:
var myArray = myJSPArray;
Where myJSPArray is declared some where in the JSP document.
This should be simple, but can I change parameters like the url coming
in:
www.testpage.com?test1=a
<script>
document.setParam("test1", "b");
</script>
something like that? I want the parameter to change based on the code..
I am new to XSL and was wondering how I would send a parameter to my XSL stylesheet?
I currently am using this Cross-Browser XML/XSLT javascript code to perform my transformations. Code:
I have an easy question, likely, that has me in a headspin. I have an
include file to a frames based site that basically forces frames on
the end user if they visit the site and hit a non-frames created
page...
Simply, it is:
if (parent != self)
self.parent.location.replace("/");
However, now I would like to force an inner frame to populate based on
what frame someone was redirected from the include (above). So, if I
visit http://domain/frame/innerframe_3.html, then I want to redirect
to the above, but pass in /frame/innerframe_3.html to be included as a
URL parameter for an inner frame to be populated.
When I modify this link to:
if (parent != self)
self.parent.location.replace("/index.php?redir=" & location.href);
Then, the replaced location doesn't seem to recognize the ?redir=
portion of the new location.
Is there a different way to do this? I can't use a META tag because I
want the TARGET to be _TOP, basically.
On IE7 I'm using a script:
function saveValues()
{
var validateOK=true;
if (typeof validate !='undefined')
validateOK = validate(document.EditForm);
if (validateOK==true) {
theAction = document.EditForm.action;
if ( theAction.indexOf('?') == -1 ) {
if ( theAction.indexOf('#') == -1 ) {
document.EditForm.action = theAction + "?__haction=apply"
} else {
posit = theAction.indexOf('#')
document.EditForm.action = theAction.substring(0,posit) +
"?__haction=apply" + theAction.substring(posit,theAction.length)
}
} else {
posit = theAction.indexOf('?')
document.EditForm.action = theAction.substring(0,posit+1) +
"__haction=apply&" + theAction.substring(posit+1,theAction.length)
}
document.EditForm.submit();
}
}
but the http parameters are not reaching the servlet.But this works
absolutely fine on IE6
what could be the possibilites for this script faliure.
I am starting to find more web pages that are using a query parameters
after the JavaScript file.
Example can be found at www.opensourcefood.com. Within the source
you'll see: <script src="/shared/scripts/common.js?revision=1.6"
type="text/javascript">.
I am trying to see if there is any big deal to this or a best practice
that is starting to creep up in the JavaScript community. If this is
used only as a way to distinguish what file of JavaScript being used
why not append something inside the file? Has anyone else seen this
or know of more reasons to do this?
Is it possible to read the computers IP address and gateway address
using Javascript?
In PHP, there is a require_once() function which includes a file only
if it is not already included. Is there an equivalent function in
Javascript (one that checks if a .js file has been included)? If not a
straight-up function, is there some other way to check if a javascript
file has been included already?
Is there a way to achieve multithreading in JavaScript? I'm looking to
fetch a page into a div while allowing the user to interact with another
div. At some point the newly fetched page contents will be available to the
div that the user is working in but I don't want to cause unnecessary
blocking. I've thought of using frames (would prefer divs) plus timeouts
and checking for when a load completes. Does anyone have an idea of how
this could work?
A friend of mine has built as simple site for use on his company's
intranet. It uses JavaScript to read comma-delimited information from a
text file and displays it in tabular form.
When I looked at the source there is js like this:
function forwardClick() {
if (sitelist.recordset.AbsolutePosition !=
sitelist.recordset.RecordCount) {
sitelist.recordset.moveNext();
} else {
alert("You are already at the last record in the database.");
}}
and HTML like this:
<OBJECT id="sitelist"
classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83" border="0"
width="0" height="0">
<PARAM name="DataURL" value="sites.txt">
<PARAM name="UseHeader" value="True">
</OBJECT>
Obviously it's a Windows and IE only thing but is there an equivalent
for non-IE browsers and/or non-Windows OS?
wondering if there is a va_list equivalent in Javascript. Well,
actually, I know that there is, but I don't know if its user...
applicable. va_list in C/++ anyhow is a way of being able to pass in
any number of arguments at the end of a function, I'll show an example:
Code: ( text )
Header:void addLine(int, const char*, ...); cpp:addLine(int line, const char *string, ...) {char *output;va_list args;va_start(args, string);vasprintf(&output, string, args);va_end(args);}
So as you can see, the space is reserved at the end of the function
declaration with the "..." syntax, and in the function body is expanded
and processed. I could be way off here, but I think I'm on the right
track.
I'm trying to find out if javascript has something akin to $$ in php.What I'm trying to do:
var costs = {
cost1: 5,
cost2: 10,
cost3: 15
}
// Retrieve cost user has selected
alert(costs.selectedCost);
Its obviously a hyper-simplified example of what I'm trying to do, but the premise is the same. In PHP, I could use $$ to convert one variable into another, not sure if JS can do the same.
I have been trying to figure out how to access files on different servers through javascript, as i am converting an onsite myspace app to an iframe app, i need to get the contents of a file from the last.fm api and store it in a variable. Or maybe i could get it with php and store it in a javascript variable if that is possible,
View 3 Replies View RelatedIs there a javascript equivalent of PHP's nl2br() function? I have to send the value of a textarea to a new window that will display the text of what was in the box, which is why I need to somehow convert newlines to breaks.
View 9 Replies View RelatedI've been using display:none on the style property of some <option>
elements in my forms, which works fine with Mozilla - as expected it
removes the option from my dropdown (although it still exists in the
code). Is there an equivalent in IE?
The reasoning behind this is that I want users to rank objects using a
<select> for each place (see below), and to remove the choice of earlier
objects from <select> drop-downs later in the list.
1st place: [<Select> with option 2 chosen]
2nd place: [<select> with option 4 chosen]
3rd place: [<select> --> Option 1
Option 3
Option 5
Option n]
Mozilla-equivalent of the following line of code:
document.getElementById('editorContent').contentWindow.event.srcElement.href
The purpose of this line is to get the "href" value of a link when clicked on inside a content-editable iframe.I have the function working perfectly in IE, but not having much luck with Mozilla browsers.
Give me a sample program for converting Ascii value into its equivalent value.for example get the input as 65(Ascii value of A) and display 'A' as output
View 1 Replies View RelatedI am running through an array and need to unset given values, but i can't seem to find the php equivalent to php's unset?[code]...
View 2 Replies View RelatedIs it possible to get the contents of an iframe (I need a method that
allows me to get the generated HTML code of an XML file that was
transformed by an XSL file)?