Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2012
    Posts
    137
    Thanks
    1
    Thanked 1 Time in 1 Post

    Can someone explain what is going on with this Json

    I am trying to figure out what the guy who created this code did here. I am taking over this project and he is gone.

    This first one is the one I need to understand

    Code:
    jxml = $.xml2json(success);

    This one is not as important.

    Code:
    JSFX_FloatDiv('floatingConsol', 10, 8).floatVert();

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,465
    Thanks
    0
    Thanked 633 Times in 623 Posts
    For the first one you'd need to find the definition of the $ object and then locate the xml2json method that has been attached to that object. Whatever that is coded to do is what that statement will do.

    For the second one you'd need to look at the code defining the JSFX_FloatDiv function - you then need to look for what type of object that function returns and then look at the code for the floatVert() method associated with that object.

    If any of thise JavaScript objects/methods/functions are defined within a framework then the documentation for the framework may tell you what they do without your having to read the JavaScript to work it out.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    Regular Coder
    Join Date
    Aug 2010
    Posts
    945
    Thanks
    19
    Thanked 205 Times in 203 Posts
    Quote Originally Posted by m2244 View Post
    I am trying to figure out what the guy who created this code did here. I am taking over this project and he is gone.

    This first one is the one I need to understand

    Code:
    jxml = $.xml2json(success);
    This one is not as important.

    Code:
    JSFX_FloatDiv('floatingConsol', 10, 8).floatVert();
    felgall has provided the correct way
    you can answer you own questions.

    here is a guess ...

    jxml = $.xml2json(success);

    success contains the
    xml results of an $.Ajax
    call $.xml2json converts
    that to javascript Object
    litteral notation and jxml
    will contain the object
    described by the xml

    JSFX_FloatDiv('floatingConsol', 10, 8).floatVert();

    aliows the div with the id of floatingConsol
    to remain in the upper left hand corner
    even when the page is scrolled
    Last edited by DaveyErwin; 09-19-2012 at 02:25 AM.


  •  

    Posting Permissions

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