I am loading a page when a user clicks on a link. I want this to load within a container. This all works fine.
What I want to do is override some of the javascript variables (to stop things from happening within the loaded object).
I've tried simply re-instantiating the variables using the same name but to no avail. Any help appreciated! Is this even possible to do? When I re-instantiate the variable, nothing actually happens to the one inside the object.
function loadURL(x){
var url = $(x).attr('value'); // eg. http://example.com
$('.page-loading-space').html('<object data="'+url+'"/>', function(){
same_variable_name = null; // that gets loaded with the object
});
}
Info
A script I am running on a different domain is being called when I load the page on eg. localhost.
Here is an example:
I am developing on localhost, and I load http://stackoverflow.com into the object tag as stated above - via $('.page-loading-space').html('<object data="'+url+'"/>'); - without the callback for simplicity.
I want to clear a variable that is instantiated within this loaded object. So, if stackoverflow.com loads for example : GoogleAnalyticsObject - which it does. I want to simply nullify that object to stop it from doing any unload callbacks.
This is all for scripts implemented on my behalf - I am aware of the bad cross domain loading etc.
All I want to do is clear the value after the page is loaded into my object to stop a callback happening when it unloads. Thanks, and sorry if I wasn't clear/or still am not clear.
?id=5then becomes?id=pineapple). If not, and the object you're loading is Flash (and you're not using uri or flashvars), then you'd have to create handle within the Flash and then set them from within JS as per (stackoverflow.com/questions/7368687/…). Otherwise, could you please provide more information