1

I have iFrame in my main html file and I'm loading a sub html in that iFrame. Sub HTML has some functions like on click of anchor tag I'm calling a function and that function is loading some page. Now in my main iFrame when I click that anchor tag of sub HTML, I want to override that function, instead of loading I want to embed some file. Right now both main html and sub html on click both are working. When I checked the event listener I saw main html click is first and then sub HTML click function. In that case how can I override it? I have tried e.preventDefault() , e.stopImmediatePropagation();

asked Apr 27, 2016 at 13:06
3
  • 2
    Can you provide some code? Commented Apr 27, 2016 at 13:08
  • Your problem is ALMOST clear... Yet according to this site standards we need to be able to reproduce your problem. As I can see you are new here... Then provide a little code and let us see how many minutes it will take to propose one OR more solutons Commented Apr 27, 2016 at 13:12
  • Sub HTML has script.js where my below code is there var $pdf = { click: function () { window.onload('test.pdf') } }; $pdf will load after the pop up Main html overriding function is below $('a').on('click', function(e) { if (url.split('.').pop() === 'pdf') { e.stopImmediatePropagation(); } else if ($(this).parent().hasClass('pdf') || $(this).hasClass('pdf') || $(this).hasClass('pdf-button-isi')){ e.stopImmediatePropagation(); /* EMBED CODE */ } } Commented Apr 27, 2016 at 17:20

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.