Reputation: 11
I just want the new page to appear in an iframe
on the current page instead of loading a whole new page.
Here's my code:
function salabim(id){
var gotoo;
var objid = document.getElementById("pgMaster");
new Effect.Shake(id);
return false;
gotoo=id+".html";
objid.src=gotoo;
location.href(gotoo);
}
This doesn't work in any browser. What am I doing wrong?
Upvotes: 0
Views: 189
Reputation: 2554
You are returning false
before you do anything with location.href
.
Upvotes: 2
Reputation: 20806
Move return false;
to the end, and use location.href
like so:
location.href = gotoo;
Upvotes: 4
Reputation: 29999
You have a return false;
in the middle of your function, so code after that return statement isn't executed.
Upvotes: 1
Reputation: 6849
location.href
is an attribute rather than a function, use location.href = url
instead.
Upvotes: 2