External site iframe

1

I have a page with% of external site%, how can I do to be able to automatically click when loading iframe on a button that has determined iframe on the external site?

Not exactly texto , classe or id , but for the text that appears in the same button, type search within name for a certain word and have a click action above the text.

The question is how to do this, is there another way to load the site in the same way as iframe does so that within my page I can interact with the external site?

Thank you for your help

    
asked by anonymous 31.10.2016 / 14:31

2 answers

2

You can access iframe by Id (best) or use $('iframe')[0]contents() , where [0] is index. If there is more than iframe , you will have to set another value.

To access an input by value do so:

$('#iframeID').contents().find('input[type="button"][value="Valor desejado"]');

Dai just use the element.

    
31.10.2016 / 14:39
0

I believe you can use a Text Highlighter plugin to find the word, and then add a click event.

Here is a website with a list of plugins that can help you with the task. Website with list of plugins

I tested with MARK.JS and I was able to do add the click the words that are found.

But I did not do the test using Iframe, but I believe that you already have an idea.

See the result on jsfiddle

 $('mark').on('click', function(){
        alert('teste');
    } );

NOTE: The code is from the mark.js website itself, I just added the lines of code above to add the event to the found words.

    
31.10.2016 / 15:10