#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2009
    Location
    Atlanta, GA, USA (unfortunately)
    Posts
    59
    Rep Power
    6

    Red face A "Code Not Executing" Question


    Hello all,

    I made a e-mail submission form script, and I have attempted to replicate it for landing pages like this one, which you'll see at the bottom of the page is a e-mail input (just one), which should be changing values as the user interacts with it.
    Code:
    // Emailbox and form handler script
    	$("#go").focus(function(){
    		if ($("#go").val() == $("#go").prop('defaultValue')){
    			$("#go").val('');
    		}
    	});
     
    	$("#go").on('focus blur', function(e) {
    	  var v = $(this).val()
    	  if (e.type == "focus"){
    		v = (v == "your e-mail")? "" : v;
    	  } else {
    		v = (v == "")? "your e-mail" : v;
    	  }
    	  $(this).val(v);
    	});
    The entire form script works in the home page of the web site, but for some reason on landing pages, it is not doing anything.

    The location of the files may be the issue.
    In the above case, the landing page is located in the 'insurance' folder.
    root/insurance/bestquoteshealthreview1.html
    The scripts folder is located here
    root/Scripts/

    I think that it's properly linked to the script though. I see the file in Dreamweaver.

    Hopefully it's a simple solve.

    Thanks!
  2. #2
  3. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,126
    Rep Power
    4304
    From Firefox's Error Console (under Tools => Web Developer):
    Error: ReferenceError: $ is not defined
    Source file: http://www.worldreviewgroup.com/Scripts/lpemailbox.js
    Line: 2
    It means that jQuery is missing.
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2009
    Location
    Atlanta, GA, USA (unfortunately)
    Posts
    59
    Rep Power
    6
    Ah ha... Silly me...

IMN logo majestic logo threadwatch logo seochat tools logo