Hi,

$('object').live('mousedown',function(){
		url = $('.m_banner_show object param[name="movie"]').attr('value');  
		alert(url);
		//filename = url.substring(url.lastIndexOf('/')+1);
		
		//pridedam paspaudima
		$.post( getBaseURL() + "index.php?option=com_ReklamuRodymas&controller=welcome&task=addClick&format=raw",{filename: filename});
		
	})

The html code:

<OBJECT id=bnr_banner2_0 codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=468 height=60 VIEWASTEXT>
<PARAM NAME="_cx" VALUE="12382">
<PARAM NAME="_cy" VALUE="1587">
<PARAM NAME="FlashVars" VALUE="">
<PARAM NAME="Movie" VALUE="uploads/banners/file4.swf">
<PARAM NAME="Src" VALUE="uploads/banners/file4.swf">
<PARAM NAME="WMode" VALUE="Transparent">
<PARAM NAME="Play" VALUE="-1">
<PARAM NAME="Loop" VALUE="-1">
<PARAM NAME="Quality" VALUE="High">
<PARAM NAME="SAlign" VALUE="">
<PARAM NAME="Menu" VALUE="-1">
<PARAM NAME="Base" VALUE="">
<PARAM NAME="AllowScriptAccess" VALUE=""><PARAM NAME="Scale" VALUE="ShowAll"><PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0"><PARAM NAME="BGColor" VALUE="FFFCDA"><PARAM NAME="SWRemote" VALUE=""><PARAM NAME="MovieData" VALUE=""><PARAM NAME="SeamlessTabbing" VALUE="1"><PARAM NAME="Profile" VALUE="0"><PARAM NAME="ProfileAddress" VALUE=""><PARAM NAME="ProfilePort" VALUE="0"><PARAM NAME="AllowNetworking" VALUE="all"><PARAM NAME="AllowFullScreen" VALUE="false">
<EMBED src="uploads/banners/file4.swf" quality=high WIDTH="468" HEIGHT="60" NAME="bnr_banner2_0" ALIGN="center" wmode="transparent" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" FLASHVARS="clickTag=http://www.google.lt&clickTarget=_blank" ></EMBED></OBJECT>

you can see there is

<PARAM NAME="Movie" VALUE="uploads/banners/file4.swf">

and I want to get the url. On google chrome it gets it, but IE alerts undefined. Have you an idea why is that?

Recommended Answers

All 16 Replies

Myabe you try param[name="Movie"]? Just want to see if IE thinks it is case-sensitive...

Myabe you try param[name="Movie"]? Just want to see if IE thinks it is case-sensitive...

I tried this. But now I checked IE developer tools and I see

<param name="movie" value="uploads/banners/file2.swf"/>

But when I choose from menu copy InnerHTML then it copies the code with capitals.

Hmm... How about test the param["..."] for other attributes to see if IE actually retrieves them correctly? If not, it may be JQuery problem.

added these lines:

test = $('.m_banner_show object param[name="quality"]').attr('value');
		alert(test);

with chrome works, with IE alerts undefined. As expected..

One quick way to fix this is to use raw JavaScript to replace the line it does not work in order to retrieve the value of param. I am not sure whether IE has getElementByName(). If not, you have to search through the param tags and look for the correct name using getAttribute("name")...

actually we can select by name. I made such html:

<A NAME="purchasing">Purchasing</A>

and js

test = $('a[name="purchasing"]').attr('name');
		alert(test);

and on IE it alerts word purchasing.

EDIT:

tried even this:

test = $('embed').attr('src');
		alert(test);

and on chrome I get the url, on IE don't get :D

I believe the attr() from JQuery may not handle it correctly with IE. You may check JQuery forum about it?

Let me ask a question?

$('object').live('mousedown',function(){
		url = $('.m_banner_show object param[name="movie"]').attr('value');  
		alert(url);
		//filename = url.substring(url.lastIndexOf('/')+1);
 
		//pridedam paspaudima
		$.post( getBaseURL() + "index.php?option=com_ReklamuRodymas&controller=welcome&task=addClick&format=raw",{filename: filename});
 
	})

Where is the class .m_banner_show?

Where is the class .m_banner_show?

There is a span with such class. I use a banner rotator and when this banner is viewed, it has that class.

<span name="banner2_0" id="banner2_0" class="m_banner_show" bgcolor="#FFFCDA" align="center" valign="top">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="468" height="60" id="bnr_banner2_0" align="" viewastext=""><param name="movie" value="uploads/banners/file.swf"><param name="quality" value="high"><param name="bgcolor" value="#FFFCDA"><param name="wmode" value="transparent"><embed src="uploads/banners/file.swf" quality="high" width="468" height="60" name="bnr_banner2_0" align="center" wmode="transparent" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></object></span>

I believe the attr() from JQuery may not handle it correctly with IE. You may check JQuery forum about it?

Hmm, read in jquery website and found this:

Cross-browser consistency: Some attributes have inconsistent naming from browser to browser. Furthermore, the values of some attributes are reported inconsistently across browsers, and even across versions of a single browser. The .attr() method reduces such inconsistencies.

But nothing concrete. Maybe I will have use jQuery forums. Or find a workaround to get the filename.

I wrote up a little code based on yours. I used your object tag information but changed the swf file. Here is the jquery code.

<script type = 'text/javascript'>
$(document).ready(function(){
	$('#bnr_banner2_0').live('mousedown',function(){
		var url1 = $('param[name="Movie"]').attr('VALUE'); 
		alert(url1);
	});
});
</script>

This is what I get in IE7 and IE8.
[IMG]http://ptconsulting.ca/popup.jpg[/IMG]

I hope this helps.

I wrote a quick page based on your object code above. I used one of my swfs but that was the only change. Here's the jQuery code.

<script type = 'text/javascript'>
$(document).ready(function(){
	$('#bnr_banner2_0').live('mousedown',function(){
		var url1 = $('param[name="Movie"]').attr('VALUE'); 
		alert(url1);
	});
});
</script>

Here is the result.
[IMG]http://ptconsulting.ca/images/popup.jpg[/IMG]

I tested with IE7 and IE8. Both the same result.

its weird but with your code even google chrome alerts undefined :D I will try maybe make a fresh html page without anything elese expect this code what we analise and then check

I finnaly made your code to work in google chrome, after changing case sensitive letters:

$('#bnr_banner2_0').live('mousedown',function(){
			var url1 = $('param[name="movie"]').attr('value'); 
			alert(url1);
		});

But on IE it still alerts undefined. :(

That is strange. I tested with Chrome, Safari and Firefox on windows and linux. The original problem as I saw it was the case of names used. Here's the code.

<OBJECT id=bnr_banner2_0 codeBase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=468 height=60 VIEWASTEXT>
<PARAM NAME="_cx" VALUE="12382">
<PARAM NAME="_cy" VALUE="1587">
<PARAM NAME="FlashVars" VALUE="">
<PARAM NAME="Movie" VALUE="uploads/banners/file4.swf">
<PARAM NAME="Src" VALUE="uploads/banners/file4.swf">
<PARAM NAME="WMode" VALUE="Transparent">
<PARAM NAME="Play" VALUE="-1">
<PARAM NAME="Loop" VALUE="-1">
<PARAM NAME="Quality" VALUE="High">
<PARAM NAME="SAlign" VALUE="">
<PARAM NAME="Menu" VALUE="-1">
<PARAM NAME="Base" VALUE="">
<PARAM NAME="AllowScriptAccess" VALUE=""><PARAM NAME="Scale" VALUE="ShowAll"><PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0"><PARAM NAME="BGColor" VALUE="FFFCDA"><PARAM NAME="SWRemote" VALUE=""><PARAM NAME="MovieData" VALUE=""><PARAM NAME="SeamlessTabbing" VALUE="1"><PARAM NAME="Profile" VALUE="0"><PARAM NAME="ProfileAddress" VALUE=""><PARAM NAME="ProfilePort" VALUE="0"><PARAM NAME="AllowNetworking" VALUE="all"><PARAM NAME="AllowFullScreen" VALUE="false">
<EMBED src="uploads/banners/file4.swf" quality=high WIDTH="468" HEIGHT="60" NAME="bnr_banner2_0" ALIGN="center" wmode="transparent" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" FLASHVARS="clickTag=http://www.google.lt&clickTarget=_blank" ></EMBED></OBJECT>

The attribute's case was not used the same way in the jQuery as here.

If you need any help let me know by posting. I'm watching while I'm working.

Thanks for the responses, I will go do something more productive, will back to this problem later or when somebody will have any thoughts how to quickly find the solution. Damn it costs so much time, the day becomes so unproductive because of IE. Thank you microsoft..

No problem. I float around in the background while I'm working. Post to the thread and I popup usually.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.