Welcome Guest, Not a member yet? Register   Sign In
What is going on? JS help
#1

[eluser]muguling[/eluser]
Hello all,

I'm new as my post counts show, and just got my hands and feet wet with CI... liking it so far... better CakePHP I think.

I did quite a few searches here and google, nothing came up. So here's my problem, I am able to link my JS files etc... CSS files work fine, but JS files wouldn't run... For example, LiveValidation script, I did a test and it just sits there. No error, no nothing. So is mootools... just a simple grab of an ID and change the text, nothing...

I have moved my system and application folders as siblings instead of parent child, here's my file structure if it has anything to do with it.

System
applications
css
js
index.php

I also tried playing with the .htaccess, link it in different ways, etc... The CSS works fine, but no javascript... *sigh*

SOMEONE HELP ME!
#2

[eluser]Randy Casburn[/eluser]
Can you provide a link that demonstrates this problem?

If not, can you post up the <head> </head> section of the generated HTML file? (and please put it in code tags).

Thanks...we'll figure this out!

Randy
#3

[eluser]muguling[/eluser]
Hi!

Thanks for dropping by! Here's the header the view generates and the test script using mootools:

/apps/ is where I have CI installed and the file structure:
Code:
/apps/
  /applications/
  /systems/
  /css/
  /js/
  index.php

My script src thing got removed, so I'm using <s> in place of script

Code:
&lt;head&gt;
&lt;link type="text/css" rel="stylesheet" href="http://domain.com/apps/css/livevalidation.css"&gt;
&lt;/link&gt;
&lt;link type="text/css" rel="stylesheet" href="http://domain.com/apps/css/reg.css"&gt;
&lt;/link&gt;
<s type="text/javascript" src="http://domain.com/apps/js/mootools.js"></s>

<s type="text/js">
window.addEvent(load, function(){
$('total_due').set('value', '$100.00');
});
</s>
<s type="text/javascript" src="http://domain.com/apps/js/livevalidation_standalone.js">
&lt;/head&gt;

So this is what it generates, it looks fine to me. Like I mentioned, CSS works fine. No problem at all. Just JS not working.

Thanks for your help!
#4

[eluser]Randy Casburn[/eluser]
Have to use spaces in your < javascript tags to get the to show up. Edit to fix please?

Also, to you use Firefox with firebug? Do you show any JS errors? Do you use the Web Developer toolbar for Firefox? If so, pulldown the [Information] and hit [View Javascript]. If your JS is not listed there...it is not being requested/loaded by the browser.

If is loaded...there there must be errors.

Let me know.

Randy
#5

[eluser]muguling[/eluser]
Thanks for the quick reply Randy! I really appreciate it!

I am playing with it now and I think I might have found the problem. I will let you know if I can get this fix.

Thanks again
#6

[eluser]muguling[/eluser]
Nevermind Randy, after looking at this stuff for the past 8 hours, I started to make some really dumb mistakes. Such as without the single quote around domready... I'll go shoot myself now. Thanks so much for trying to help this dummy Tongue
#7

[eluser]Randy Casburn[/eluser]
[quote author="muguling" date="1219474634"]Hi!

Code:
window.addEvent(load, function(){
$('total_due').set('value', '$100.00');
});

[/quote]

I was going to mention the 'load' above too ;-)

Best of luck to you,

Randy




Theme © iAndrew 2016 - Forum software by © MyBB