[eluser]jcopling[/eluser]
From the documentation:
Quote:Here are some examples:
echo anchor('news/local/123', 'My News');
Would produce: <a href="http://example.com/index.php/news/local/123" title="My News">My News</a>
echo anchor('news/local/123', 'My News', array('title' => 'The best news!'));
Would produce: <a href="http://example.com/index.php/news/local/123" title="The best news!">My News</a>
The anchor and anchor_popup functions from the URL helper do not return URL strings, they return HTML anchor entities. So by using the anchor function to set the window location you would be producing something like:
http://<a href="http://www.mydomain/com">Click Me!</a>
Instead, you would use the base_url function to produce the URL string that you want to direct to:
Code:
onClick="window. location. href='<?= base_url();?>news/local/123;"