SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Feb 2014
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Messy Jquery text, how to read?

    Hi

    I got this messy Jquery text , how do I read this properly per function ect as it opens as a ball of text in notepad++
    I cant make any sense out of it and I need to remove some code but dont know where to look for it.

    jquery.jpg

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,169
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    Looks like you have the minified version - not human readable, but optimized for machines.

    Can you you get a "non-min" version of the same code?

  3. #3
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,198
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    Paste your code here http://jsbeautifier.org/ and press control + enter.

  4. #4
    SitePoint Member
    Join Date
    Feb 2014
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Paste your code here http://jsbeautifier.org/ and press control + enter.
    Sweet. Thanks... again... Ralph.

    Appreciate it. Learning every day.

    Why does one put a mini version on their website? Is that shorter even or just a different format of same type of code? And.. how does one convert a normal code back to mini?

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,815
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by dutchdog View Post
    Sweet. Thanks... again... Ralph.

    Appreciate it. Learning every day.

    Why does one put a mini version on their website? Is that shorter even or just a different format of same type of code? And.. how does one convert a normal code back to mini?
    The minified version is usually somewhere between 50% and 80% of the size of the original version and therefore will load significantly faster.

    A minified version is basically the same JavaScript code (all jQuery code is JavaScript code) with all the comments and unnecessary spaces removed.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,198
    Mentioned
    456 Post(s)
    Tagged
    8 Thread(s)
    No probs. Glad to help.
    Quote Originally Posted by dutchdog View Post
    how does one convert a normal code back to mini?
    There are lots of tools for "minifying" JS, so a quick Google search will turn them up. I don't have any bookmarked, as I don't have much use for them ATM.


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
  •