Wednesday 15 September 2010

load jquery script in head section of specific magento cms page -


Now I'm trying to get a JS script to load in my head section for two days. And it still does not work .. I am creating a CMS page with a form in which you can order some product samples (maximum 5) in the page N, to send the message to the request A small contcat is

Required Setup: - Print Text - A Grid With Picture And Checkbox - A Contact Form Below To Submit Sample Request

At this point, I have almost all the potential Efforts of options - Custom page layout xml

  & lt; Reference name = "head" & gt; & Lt; Action Method = "Edge Age" & gt; & Lt; Script & gt; JS / MyJS & lt; / Script & gt; & Lt; / Action> & Lt; / References & gt;   
  • A custom samplerequest.phtml and loaded via {{block type = "core / template" template = "page / kleurstalen.phtml"}}

  • js true page Xml etc. added

    This is the jquery code I want to load:

      & lt; Script type = "text / javascript" & gt; Jq (document) .ready (function () {jquery ('# kleurstalenform') Submit (function () {if (jQuery ('input: checked') length == 0) {Warning ('heyft geen stofstallen geselecteerd' Click '' ',' function '(if (jq (' input: check '). Length> 4) {jq (this). Etr (' check ', false); warning (' u cunt Maximum 4 stostellan beings on an average. ');}});}); Var $ j = jQuery.noConflict (); & lt; / script & gt;   

    Let me have a clue Why does not this work? Probably this is the scope of the issue?

    Thank you for your advice!

    Best

    A < / Div>

    You should have checked in the console (F12 in Chrome Developer Tools) because I'm thinking that you have corrected the script to my.js Custom page layout by adding to the head block. Xml However, the JS errors added by you will be filled with errors, which is why it is not working.

    You can use jQuery , < Code> jq and you are finally setting the noConflict variable by using $ j Not.

    You also include a JS file through the addJs method, so there is no one in the file & lt; Script & gt; needs to open and close the tag my.js. Try the script below and see if you get anywhere;

      var $ j = jQuery.noConflict (); $ J (document) .ready (function () {$ j ('# kleurstalenform'). Submit (function () (if ($ j ('input: checked'). Length == 0) {Warning ('U Hefted bind ('click', function () (if ($ j ('input: check'). Length & gt; 4) {jen stofstallen geselecteerd} $ j (this) .attr ('check', false); warning ('You cant max 4 stostlartern BJ on onsurance.');}}};});    

No comments:

Post a Comment