I am trying to use jqModal to open some external links via AJAX using this code:
<h3><a class="username<?php echo $row['id']; ?>trigger"><?php echo get_user_meta( $user_id, 'first_name', $single );?> <?php echo get_user_meta( $user_id, 'last_name', $single );?></a></h3>
<script type="text/javascript">$(document).ready(function() {$('#username<?php echo $row['id']; ?>').jqm({ajax: 'http://www.google.ro/', trigger: 'a.username<?php echo $row['id']; ?>trigger'});}); </script>
<div class="jqmWindow" id="username<?php echo $row['id']; ?>">Please wait... <img src="inc/busy.gif" alt="loading" /></div>
The problem is that it doesn’t load but if I put an internal link it works. Someone can help me with this?
What you are trying to do is cross domain Ajax. Jqmodal and any other plugins will not be able to do that.
Jqmodal has an iframe method to pull in an external website. See point 7. On the jqmodal page.
You will need to use an API if the external site has one, or use server side code to ‘scrape’