Larry Brister
asked on
Javascript and Jquery not firing
In my code below...
My code is ALWAYS loading the favicon.ico.
Even though... my alert works and tells me that it should swap out based on url.
My code is ALWAYS loading the favicon.ico.
Even though... my alert works and tells me that it should swap out based on url.
<script type="text/javascript">
$(window).load(function () {
var id = document.location.href.toString().indexOf("verif");
var n
if (id == -1) {
$('head').append('<link href="favicon2.ico" rel="shortcut icon" type="image/x-icon" />');
}
else {
$('head').append('<link href="favicon.ico" rel="shortcut icon" type="image/x-icon" />');
}
alert(id);
});
</script>
While your code would probably work to change an image in the 'body' of a page, I'm not sure that changing 'favicon.ico' in the 'head' after the page loads like that will have any effect. 'favicon.ico' is the 'standard' file name that browsers look for. If there isn't any 'favicon.ico' already defined in the 'head' section, I don't think the browser will go back and look again. It will just try to load the 'standard' version.
ASKER
That same code works on a Master page
Just not a regular aspx page
Just not a regular aspx page
if it work on a master page, just be sure to have jquery plugin correctly referenced, there's no other difference IMHO
ASKER
Leakim'
What should the reference be?
What should the reference be?
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.
ASKER
Taking a look guys
ASKER
azarc3 and leakim971
I agree... something is profoundly weird here.
Both of your suggestions get me working locally with the Login page as well as the Master Page
But on the actual server... the Master works and the login does not.
I will award points on this question splitting them for you both and formulate a new question after reviewing other possibilities.
I agree... something is profoundly weird here.
Both of your suggestions get me working locally with the Login page as well as the Master Page
But on the actual server... the Master works and the login does not.
I will award points on this question splitting them for you both and formulate a new question after reviewing other possibilities.
ASKER
Thaks folks