evibesmusic
asked on
How to evalute address bar location and return a specified result?
Experts,
How can I alter this java script to evaluate the address bar location, then produce a desired result?
Current Statement:
function at_attach(parent, child, showtype, position, cursor){
...
c.style.visibility = "hidden";
...
}
Desired Statement/Functionality - syntax is wrong of course:
if Current URL= 'index.php?cmd=account&res ult=succes s' {
function at_attach(parent, child, showtype, position, cursor){
...
c.style.visibility = "";
...
}
}
How can I alter this java script to evaluate the address bar location, then produce a desired result?
Current Statement:
function at_attach(parent, child, showtype, position, cursor){
...
c.style.visibility = "hidden";
...
}
Desired Statement/Functionality - syntax is wrong of course:
if Current URL= 'index.php?cmd=account&res
function at_attach(parent, child, showtype, position, cursor){
...
c.style.visibility = "";
...
}
}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
After rereading, you may want to put the test inside the function declaration instead of around it:
function at_attach(parent, child, showtype, position, cursor){
if(/index.php\?cmd=account&result=success/i.test(window.top.location.href)) {
...
c.style.visibility = "";
...
}
}
ASKER
@for_yan:
Thank you. The solution worked perfectly and the first time.
I will ask the moderator to move the question to the Java Programming Language zone.
Cheers!
Thank you. The solution worked perfectly and the first time.
I will ask the moderator to move the question to the Java Programming Language zone.
Cheers!
You are always welcome.
ASKER
Cheers!
it should not be posted to "Java Programming Language" zone