![]() |
jQuerty attr in Codeigniter - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: jQuerty attr in Codeigniter (/showthread.php?tid=43984) |
jQuerty attr in Codeigniter - El Forum - 07-29-2011 [eluser]Fredrik-s[/eluser] Hello, I try to open a link with jQuery's attr-code. But it doesn't work, the url won't change in Codeigniter. Is Codeigniter messing this up? For the exact same code works when not using Codeigniter. Greetings Fredrik-s jQuerty attr in Codeigniter - El Forum - 07-29-2011 [eluser]regal2157[/eluser] whats the value jQuery provides you in CI? possibly post a little code or link jQuerty attr in Codeigniter - El Forum - 07-29-2011 [eluser]Fredrik-s[/eluser] [quote author="regal2157" date="1311988959"]whats the value jQuery provides you in CI? possibly post a little code or link[/quote] Thanks for reply regal2157! I use the following jQuery/Javascript code: Code: $('#linkness').attr('href', 'http://google.com'); And the following URL structure Code: <a id="linkness" href="#">An anchor</a> When I the hover the link on a page where I use CI, I get the link structure of the current page I'm on and not "http://google.com". But when I do the exact same on a page not using CI, the link shows correct and I can click it and go to "http://google.com" How come? jQuerty attr in Codeigniter - El Forum - 07-29-2011 [eluser]regal2157[/eluser] Is your jquery source correct? also, I am not seeing the point of this honestly.. why would you not just make the href the link. jQuerty attr in Codeigniter - El Forum - 07-29-2011 [eluser]byde[/eluser] pls, post all you jquery code jQuerty attr in Codeigniter - El Forum - 07-31-2011 [eluser]Fredrik-s[/eluser] I found a thread - can't find it now - stating that CI breaks the jQuery link structure which makes the code provided not working. And there were some work around to manage the jQuery link structure. Here is the code doe: View-file Code: <div class="demo"> header thats get included: Code: <!DOCTYPE html> jQuerty attr in Codeigniter - El Forum - 07-31-2011 [eluser]byde[/eluser] $('b').attr('href', 'http://google.se'); ??????? try $('#b').attr('href', 'http://google.se'); |