1

How to get clickTAG url and click on that url using jquery

here the sample code

<object type="application/x-shockwave-flash" flashvars="clickTAG=http://testing.com"></object> 

Regards Dev

2 Answers 2

1

try this code, you will get url in variable now you can apply action on url eg. click or window.location..

$(function() { $("object[flashvars^=clickTAG]").on('click', function(Event) { var url = $(this).attr('flashvars').split('=')[1]; alert(url); }) })
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <object type="application/x-shockwave-flash" flashvars="clickTAG=http://testing.com">Object Test</object>

Sign up to request clarification or add additional context in comments.

4 Comments

can i autoclick that url
yes you can add trigger $("object[flashvars^=clickTAG]").trigger('click') on document ready, but that is blocked due to browser security reason, may be you will need to allow once, the answer would be useful for blocked popup stackoverflow.com/a/23393900/926333
it's not working it's showing file:///C:/Users/ncpl/Desktop/ before url
at least run on server? not direct file
0
var v = $("object").attr('flashvars'); var url = v.split('=')[1]; window.location.href = url; 

This could get you to the url of the object!

DEMO

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.