JQUERY href disabling issue

I'm currently working on a home-made full front-office 100% javascript CMS of ours, and I'm having quite a problem. Some of the editable areas the user can edit are contained in href link. These href's are NOT editable, yet, when the user clicks on these zones (while in edition mode) browser follows these links. First, heres an example of html generated by the CMS : Here, for example, the user can only change the ; So I tried to manage the surrounding href that way : var referenceZone = $(this).attr("id"); $("#"+documentId+" a").each(function() { $(this).click(function() { return false; }); }); Where referenceZone is my surrounding `` Is this as tricky as it seems to me ? <**** EDIT ****> Added a sandbox for testing purposes here : [http://jsbin.com/aboke/2][1] <**** EDIT 2 ****> What I don't understand is that alert(event.type) doesn't even fire up !! //click event disabling on any href of curently edited ${"span.document"} $("span#" + documentId + " a").click(function(event) { alert(event.type); event.preventDefault(); suppressionZoneModifiable(documentId); recupererTexte(referenceZone, documentId); }); [1]: http://jsbin.com/aboke/2

以上就是JQUERY href disabling issue的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准