Help please my javascript is not working in CI.. - 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: Help please my javascript is not working in CI.. (/showthread.php?tid=51385) Pages:
1
2
|
Help please my javascript is not working in CI.. - El Forum - 05-02-2012 [eluser]kit005[/eluser] I'm a newbie in codeigniter, my problem is the javascript it doesnt work in Ci though my css goes well in it.. I just cant find my mistake.. Hope somebody can help me.. I appreciate it so much.. My home page Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <base href="<?php echo base_url();?>" /> <title>My Page</title> <meta http-equiv="Content-Language" content="English" /> My root derictory +system +application -views -index -view2 -display -display2 -controller +index +js -function -jquery -js_lib -soon +css -style.css -stylerd.css My problem is, when the user inputs it doesnt fetch the data and direct to the other page, it remain just in that page.. My controller Code: <?php It works well in php but when i transfer it in CI i got a hard time.. :down: Help please my javascript is not working in CI.. - El Forum - 05-02-2012 [eluser]kit005[/eluser] My the removed code is my link to the javascript it goes like this.. [removed][removed].. Help please my javascript is not working in CI.. - El Forum - 05-02-2012 [eluser]InsiteFX[/eluser] To post javascript code you need to replace the s in the script tags with a $ then it will post. Code: <$cript> Because that is what we need to see is your javascript code. Help please my javascript is not working in CI.. - El Forum - 05-02-2012 [eluser]kit005[/eluser] <$cript language="javascript" src="<?php echo base_url();?>js/function1.js"></$cript> <$cript language="javascript" src="<?php echo base_url();?>js/function.js"></$cript> <$cript language="javascript" src="<?php echo base_url();?>js/checkform3.js"></$cript> <$cript language="javascript" src="<?php echo base_url();?>js/jquery.js"></$cript> //this is my library. <$cript language="javascript" src="<?php echo base_url();?>js/js_lib.js"></$cript> //this is my library. Heres my removed code. tnx Help please my javascript is not working in CI.. - El Forum - 05-02-2012 [eluser]InsiteFX[/eluser] Well your problem is in one of your javascript files were it is not seeing the correct paths to your controller! You can do this and have access to both base_url() and site_url() Code: <head> Now you can use base_url and site_url in your javacript files like this: Code: url: base_url+"path_to_controller"; Help please my javascript is not working in CI.. - El Forum - 05-02-2012 [eluser]kit005[/eluser] Thank you ill try it in my codes.. Hope it'll work fine, so simple yet so hard..^_^ Help please my javascript is not working in CI.. - El Forum - 05-02-2012 [eluser]InsiteFX[/eluser] Most of the time when javascript doe's not work it is because of the paths. Help please my javascript is not working in CI.. - El Forum - 05-02-2012 [eluser]kit005[/eluser] I still get the same result.. Help please my javascript is not working in CI.. - El Forum - 05-02-2012 [eluser]InsiteFX[/eluser] Try changing this: Code: // form this. Help please my javascript is not working in CI.. - El Forum - 05-02-2012 [eluser]ojcarga[/eluser] Also look this: Code: <form method="GET" id="myform" name="myform"> It seems you are opening the form twice. And closing it twice too Code: <?php echo form_close(); ?> |