• I have a series of links to PDF files on my page. As they click on a link I want to display the PDF file without redrawing the page – AJAX. Can I introduce and view a PDF using AJAX and your plugin?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Thomas McMahon

    (@twistermc)

    I haven’t tried that so I’m not sure. If you do try it, let me know if it works.

    Thread Starter wmchugh

    (@wmchugh)

    Thanks for responding, Thomas. I was trying another PDF viewer plugin and got it working with AJAX, so my search is over for now. What learned is that there is no problem using AJAX, and in the PHP code doing do_shortcode(‘[shortcode att1=”value” att2=”value” etc]’); For what it’s worth, this works, however …
    If the shortcode doesn’t just produce fully functional HTML, but requires JS processing to get it working, you likely have to call something on return from the AJAX call to make that happen. And, if the shortcode doesn’t appear anywhere on the initial page, the JS supporting the shortcode probably hasn’t loaded – so you’ll have to take some action to make it load. But, if these things can be takrn into account, then hot swapping PDF fles being viewed on a page, without using an iframe, is possible (and very cool).
    Of course if you are using an iframe then you don’t need AJAX at all.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Can I use AJAX to insert shortcode?’ is closed to new replies.