Javascript Nightmare |
[eluser]Lone[/eluser]
Less the one '/' before assets as your base_url should have a trailing slash. Quote:<?php echo base_url(); ?>assets/css/style.css Sorry michael ![]()
[eluser]psdtocode[/eluser]
It doesn't seem to be working. The ouptut cuts off right before the code I inserted: <?php echo base_path(); ?>. I tried both short tags and normal syntax, even though both should work. No PHP errors are being outputted (though I have yet to see one, not sure how to turn them on ATM). Here is my code (don't want to go through trying to post HTML again): http://www.grabup.com/uploads/f093dd5edc...946b8f.png Here is the source it outputs: http://www.grabup.com/uploads/0c4be0bef9...33c4cb.png
[eluser]Crimp[/eluser]
Don't forget to: Code: $this->load->helper('url'); I tend to put this in autoload 'cause it's so handy.
[eluser]psdtocode[/eluser]
Ah, okay, thanks. I didn't know base_url() was part of the url helper. I also figured it that was true, then it would show an error. I finally got it included, however, now the JS itself isn't working (not sure if it's my code or if prototype still isn't being included even though the path works and I get no error): $('link').onclick = function() { alert('hi'); } <a href="#" id="link">asdf</a>
[eluser]Michael Wales[/eluser]
Code: $(’link’).onclick = function() { Isn't Javascript case sensitive? Plus, just doing a quick review of the Prototype API documentation (I'm a jQuery user, myself) - this seems to be more appropriate: Code: $('link').observe('click', alertLink); or even: Code: $('link').observe('click', function(event) {
[eluser]psdtocode[/eluser]
Didn't work. I'm in Minnesota just on my mac, so I'll play around with it on my PC when I have more time. ![]()
[eluser]adwin[/eluser]
I did like this I created a directory named public/ Code: /- root and i put this on my view (header) Code: <l i n k href="<?=$this->config->item('base_url');?>public/css/mycss.css" rel="stylesheet" type="text/css" />
[eluser]@li[/eluser]
Install firebug and run the page in firefox to see exactly what javascript error you get |
Welcome Guest, Not a member yet? Register Sign In |