take the variables out of the quotes, you're just passing strings.
that should sort it out.

jjshell wrote:
Thanks for your answer.

I did it. Now livequery is applied as expected, and the redirect issue
has disappeared. But... the ajax content never gets loaded into the
modal box. Yet the modal box opens. It just doesn't get loaded with
any content. If I use {ajax: 'url'} it gets loaded, but the query
string doesn't seem to pass to the server... (yet when I alert() it,
the url variable displays the expected url, with the query string and
everything).

Here's my code:

var url;
  $('a.edit').livequery('click',function(){
  url = $(this).attr('href');
  return false;
});

$('#modal-test').jqm({
  //ajax: 'url',//for testing.. loads the html content, but the
queryString is ignored for some strange reasons.
  ajax: '@href', //never gets loaded
  ajaxText: '<img src="http://localhost/troglodytes_public/images/ajax-
loader.gif" />', //this turns endlessly, no ajax loaded content
replaces it.

  onHide: function(h) {
    url= url + 'session/close/';
    $.get(url);
    h.o.remove(); // remove overlay
    h.w.fadeOut(1); // hide window
  },
});

$('a.edit').livequery('click',function(){
  $('#modal-test').jqmShow();
  return false;
});




On 29 juil, 10:44, Liam Potter <radioactiv...@gmail.com> wrote:
uncomment the return false



jjshell wrote:
Hi,
Please consider the code below. It should open a modal everytime a
link of a given class is clicked. But... it does not.
//get the url of the link clicked
var url;
$('a.edit').livequery('click',function(){
  url= $(this).attr('href');
});
//initiate the modal box
$('#modal-test').jqm({
  ajax: '@href',
  trigger: false;
  onHide: function(h) {
    url = url + 'removeSession/edit/';//remove session
    $.get(url);
    h.o.remove(); // remove overlay
    h.w.fadeOut(0.88); // hide window
  },
});
//now display the modal
$('a.edit').livequery('click',function(){
  $('#modal-test').jqmShow();
  //return false;
});
When a link of class .edit is clicked, the overlay covers the page for
an instant, then a redirect occurs to the page that should be loaded
in the modal box (instead of the page being loaded in the modal).
It's probably a small mistake as I can get it working the way I want
using jqm 'trigger:a.edit'. The problem with this approach is that I
lose the livequery power (links from ajax loaded content won't fire
jqm).
Thanks in advance for your help. Regards, -jj. :)- Masquer le texte des messages précédents -
- Afficher le texte des messages précédents -

Reply via email to