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
    124
    Thanks
    9
    Thanked 26 Times in 17 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
    261
    Thanks
    22
    Thanked 42 Times in 34 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. Header already sent problem in magento
    By david in forum Programming & Development
    Replies: 2
    Last Post: 07-08-2021, 06:09 AM
  2. Simple uploader Using PHP
    By speed2x in forum PHP programming
    Replies: 2
    Last Post: 22-04-2019, 09:48 AM
  3. A simple php captcha script
    By david in forum PHP programming
    Replies: 4
    Last Post: 14-03-2019, 07:25 AM
  4. SEO Problem Updrade Version 1.3. to 1.5
    By Julia Meier in forum Magento SEO technique
    Replies: 6
    Last Post: 28-04-2016, 04:01 PM
  5. Replies: 0
    Last Post: 12-06-2013, 08:39 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
  •