Javascript links using anchor(); - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Javascript links using anchor(); (/showthread.php?tid=57613) |
Javascript links using anchor(); - El Forum - 03-27-2013 [eluser]Iván Argulo[/eluser] If you want to use the anchor() function for javascript links, you just have to change a little bit the url_helper, line 149, as follows: Code: $site_url = ( ! preg_match('!^\w+://! i', $uri)) ? site_url($uri) : $uri; Replace with: Code: if (substr($uri, 0, 10) == 'javascript') Or you can download the modified file attached to this post. With this change, you can do this (note: the "javascript" word is removed for security). Code: anchor('[removed] doSomething()', 'Do something', 'title="Do something"'); |