Magento Expert Forum - Improve your Magento experience

Results 1 to 5 of 5

How do I Solve This Simple Magento JQuery Problem!

  1. #1
    Junior Member
    Join Date
    Jun 2013
    Location
    Lahore,Pakistan.
    Posts
    11
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Lightbulb How do I Solve This Simple Magento JQuery Problem!

    Hello Sir,

    I want to add some of my own jquery code(given below) in magento 1.7.0.0 for a html tag(given below) that I have on html source of home page(CMS=>pages=>home page=>content=>html).how can I do it? also please tell me that if I want to apply that code on all page then how would I do that? (I have already installed the jquery extension(http://connect20.magentocommerce.com...ento_JQueryLib) so magento is already setup to use jquery).thank you.

    here is the jquery code:

    <script type="text/javascript\">
    $(document).ready(function(){
    var pContent = $(’p’).text();
    alert (pContent);
    });
    </script>

    here is the html tag(on which i am applying this code):

    <p>Happy Shopping!</p>

    View more threads in the same category:


  2. #2
    Moderator shunavi's Avatar
    Join Date
    Mar 2013
    Posts
    130
    Thanks
    10
    Thanked 29 Times in 15 Posts

    Default

    I think you are very new with magento. Then this is what very simple I suggest you do for this problem.

    - Login to back end

    - Browse menu: System => Configuration => Design

    And you can see "Miscellaneous Scripts" then you can enter any jquery script there

    Cheers

  3. The Following 2 Users Say Thank You to shunavi For This Useful Post:

    indusstar777 (20-06-2013),Parth Patel (31-07-2013)

  4. #3
    Junior Member
    Join Date
    Jun 2013
    Location
    Lahore,Pakistan.
    Posts
    11
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Your answer is very helpfull and i think that half of the problem is solved.
    I have tried the javascript instruction: alert("Happy Shopping!"); in "Miscellaneous Scripts" and it is working fine but the jquery code is not being executed as i told you that I have already installed the jquery extension(http://connect20.magentocommerce.com...ento_JQueryLib but i think this extension is not working can you tell me how to install jquery to magento 1.7.0.0 so that i move on with my jqury code.thank you.

  5. #4
    Administrator david's Avatar
    Join Date
    Nov 2012
    Posts
    260
    Thanks
    23
    Thanked 40 Times in 33 Posts

    Default

    You can edit this file:

    app\design\frontend\<your theme folder>\<your theme name>\template\page\html\footer.phtml

    Then add whatevery like jquery or javascript code here as normal. Just keep in mind that it only work for the selected theme.

  6. The Following User Says Thank You to david For This Useful Post:

    indusstar777 (20-06-2013)

  7. #5
    Junior Member
    Join Date
    Jun 2013
    Location
    Lahore,Pakistan.
    Posts
    11
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Thank you very much my problem is solved and everything is working fully well now.thank you.

Similar Threads

  1. SEO Problem Updrade Version 1.3. to 1.5
    By Julia Meier in forum Magento SEO technique
    Replies: 6
    Last Post: 28-04-2016, 05:01 PM
  2. Simple uploader Using PHP
    By speed2x in forum PHP programming
    Replies: 0
    Last Post: 14-07-2013, 06:19 AM
  3. A simple php captcha script
    By david in forum PHP programming
    Replies: 3
    Last Post: 12-06-2013, 10:10 AM
  4. Replies: 0
    Last Post: 12-06-2013, 09:39 AM
  5. Header already sent problem in magento
    By david in forum Programming & Development
    Replies: 0
    Last Post: 14-04-2013, 06:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •