[eluser]korukyu[/eluser]
Hi, sorry. Total newb here. I'm new to CI and I was trying to modify the HTML helper by adding a script_tag function. I made a new helper (my_html_helper), and I changed some of the code from the original link_tag function.
Code:
function script_tag($src='', $type = 'text/javascript')
{
$CI =& get_instance();
$script = '<xscript ';
if ( strpos($src, '://') !== FALSE)
{
$script .= ' src="'.$src.'" ';
}
else
{
$script .= ' src="'.$CI->config->slash_item('base_url').$src.'" ';
}
$script .= '" type="'.$type.'" ';
$script .= '/>';
}
I added the 'x' in the script tag because the forum eats script tags, apparently. :lol:
Then when I call it, I call
Code:
echo script_tag('js/quiz.js');
Of course, it doesn't work.

hut: I'm sure I'm screwing something up royally, and I thought I'd ask the experts! Any ideas?