[jQuery] Browser compatibility
I'm new to jQuery and have a simple script to set up an object in the
markup. It works fine on FireFox and Opera, but fails to do anything
in IE7. Are there steps I'm missing to make it work on all three?
Here's the code in its simplest form:
<head>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
var
objectID = "myID";
classID = "myClassID";
srcUrl = "http://www.myurl.com/";
codeBase = srcUrl+"download/mytest.exe";
appID = "myAppID";
appInit = "AppInitString";
$("object").attr("id", objectID);
$("object").attr("classid", classID);
$("object").attr("codebase", codeBase);
$("param[@name=AppID]").attr("value", appID);
$("param[@name=SrcURL]").attr("value", srcUrl);
$("param[@name=AppInit]").attr("value", appInit);
$("object").each(function(i)
{
alert( this.getAttribute("id") );
alert( this.getAttribute("classid") );
alert( this.getAttribute("codebase") );
});
$("param").each(function(i)
{
alert( this.getAttribute("value") );
});
});
</script>
</head>
<body>
<object width='900' height='600' id='' classid='' codebase=''>
<param name='AppID' value='' />
<param name='SrcURL' value='' />
<param name='AppInit' value='' />
</object>
</body>
Thanks!