javascript - jQuery live function is not, well, functioning -


I am generating content using Ajax and therefore using .live () The need to generate links on the generated link does not work unfortunately, and I'm not sure why I tried to put it inside and outside the domed context; No fate It was working when I just got to $ ('a'). Click () was using, but did not work on Ajax links that were dragged from any idea?

  $ (document) .ready (function () {$ ('# content a'). Live ('click', function () {var moveIt = $ ("# content () ; External Wide (); Warning (driven); $ ('# content'). Emamate ({'MaxWidth': '+ =' + Left it / 2 + 'PX', 'left': '6%'} , 'Slow');}); $ ('a.back') live ('click', function () {$ ('# content'). ({'MaxWidth': '360px', 'left': '43% '}, 400);});});   

And here is HTML:

  
id = "content" Class = "textile" & gt; & lt ;! - start content -> gt; id id = "ajax-container"> gt; id id = "ajax-content" & gt; & lt; ;! - TEST - & gt; & lt; h1 & gt; Installations & lt; / h1 & gt; & lt; a rel = "bookmark" Href = "http://www.qp2creative.com/clients/dfrank/installations/light-fixtures" title = "lighting and fixtures">  seating area with light fixtures gt; & lt; a & gt; & lt; a rel =" bookmark "Href =" http://www.qp2creative.com/clients/dfrank/installations/scad-fibers-installation "title =" SCAD fiber and installation "& gt; & Lt; Img src = "http://www.qp2creative.com/clients/dfrank/images/49t.jpg" alt = "installation in context" height = "64" width = "140" & gt; & Lt; / A & gt; & Lt; A rel = "bookmark" href = "http://www.qp2creative.com/clients/dfrank/installations/other-gallery" title = "Fashion 2008 & Photoshoot" & gt; & Lt; Img src = "http: //www.qp2creative.com/clients/dfrank/images/47t.jpg" alt = "fashion background" height = "64" width = "140" & gt; & Lt; / A & gt; & Lt; A rel = "bookmark" href = "http://www.qp2creative.com/clients/dfrank/installations/qp2-creative-gallery" title = "QP2 Creative and Gallery" & gt; & Lt; Img src = "http://www.qp2creative.com/clients/dfrank/images/41t.jpg" alt = "QP2 Creative Gallery" title = "" & gt; & Lt; / A & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt ;! - & Ajax container - & gt; & Lt; / Section & gt; & Lt ;! - End content - & gt; Your JavaScript code is being messed up inside body tag

body tag Binding Click in the Body Tag " Return " with the script inside the head tag . And it prevents any "click" binding from calling.

I found three problems in your code, after correcting it, I got the alert box.

  1. Your code wrapped inside $ (document) .ready (function () {}); question (but this demo is not in the site)
  2. relink: function () { your body tag - commented " smd_ajax.spinit (1); <
  3. (Site_url.indexOf (url.host)> = 0) when correcting the missing semicolon in / strong>

      & Amp; (Bindit == true)) {smd_ajax.spinit (1); // edit 3 here jQuery (this) .unbind (); Smd_ajax.grab (this.href); //return false; // edit 2 here}     

    To prevent you from default behavior, preventDefault (); . Live ('click', function (e) {var moveIt = $ ("# content")

      $ (document) .ready (function () {$ ('# content a' ) External Wide (moveIt); ($ '' 'content' // hyperlink page link will not load.)); $ ('A.back') live ('click', function () { $ {'MaxWidth': '360px', 'left': '43% '}, 400);});});    < / Html>

Comments