views:

25

answers:

1

I am having difficulty trying to get modernizer to run with codeigniter.

this is what I've done so far.

  1. downloaded Modernizr and renamed the file modernizr-1.5.min.txt to modernizr-1.5.min.js

  2. put the JavaScript file in the same directory as my header file is: apppath/views/tops/

  3. included the file in my headings <script src="modernizr-1.5.min.js"></script>

  4. included this in my HTML element <html class="no-js">

  5. just to preserve my sanity I put the JavaScript file modernizr-1.5.min.js in my views directory and in the application directory.

I am getting absolutely zero response when I read my page source to see if the has been replaced with the elements that my browser covers the wave modernizr is supposed to work. I have tried this using Firefox and chrome as far as reading the source.

any suggestions? Thank you in advance

+1  A: 

why would you put javascript files ito the view folder of your app? i would rather use this path "/media/javascripts/modernizr.js" and then <script src="/media/javascripts/modernizr.js"></script> link it like that. the view folder is only for templates. other thing is that you will never see the changes that javascript does to your page in the pagesource. because it only shows you what html the browser received. and javascript starts to work after the browser received the html. you need to install firebug to see the "live" dom.

antpaw
Well I put the Script file there just to see if I could get it to work. Using firebug I dont see anything either in the html tab.
Brad
OK I got it to work using your suggestion to move the JS file. Thank you very much Antpaw
Brad