[Javascript] Javascript echo()?
tedd
tedd at sperling.com
Sat Oct 6 09:48:12 CDT 2007
At 1:31 PM -0700 10/5/07, Hassan Schroeder wrote:
>tedd wrote:
>
>>>> How can I send both a php and a javascript variable at the same time?
>
>> Is there a way to tie an open window to javascript's window object?
>> Or, perhaps another solution to the original problem?
>
>I'm totally mystified what "window.open" has to do with the original
>question, but in any case, this should do it --
>
>function add_my_value(val) {
> document.getElementById("x").href += "&t=" + val;
>}
>
><a id="x" href="foo.html?s=bar">something</a>
Hassan:
Your mystification was justified -- it should have been
window.location instead of window.open.
In my case, your suggestion using document.getElementById would not
have worked because there was more than one link. In fact, it was in
a loop that showed the contents of a directory for the user to select
from.
As such, I could only use document.getElementByClass (or whatever),
which as you know it not supported by some browsers.
I'm mystified that document.getElementById is supported, but
document.getElementByClass is not.
In any event, yhanks very much for your help.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
More information about the Javascript
mailing list