SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 45 of 45
  1. #26
    SitePoint Enthusiast
    Join Date
    Apr 2011
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    Only if it provides a working example as a starting point.

    The body of that code is empty, so how can it be a working example?

    Code:
    <body >
    
    
    
    </body>
    cause the main thing it , it is run on the script there no body, that why i say that i use javascript language, so it work on script itself...basically is like i create a script

  2. #27
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,678
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Thank you. Now that we have a known working example, it seem now that my updated code from post #10 does work after all.

    All you need to do from there is to add the link path to your data list, which was also mentioned in the same post.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #28
    SitePoint Enthusiast
    Join Date
    Apr 2011
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    are you able to page? cus in the post 10 you say to remove the currentStart and currentCount
    Oh great, they must be global variables that dojo uses. That's one of the dangers that I face when trying to help with something that I'm not familiar with.

    Yes, leave those in, but don't define them as variables. Just leave them at the top of the function, as in the working example.

    The code in post #10 has been updated to reflect this change.

  4. #29
    SitePoint Enthusiast
    Join Date
    Apr 2011
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    Thank you. Now that we have a known working example, it seem now that my updated code from post #10 does work after all.

    All you need to do from there is to add the link path to your data list, which was also mentioned in the same post.
    hey can u show me how your data is change cause after i change and i click on the link, it promot me this error....
    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    The resource cannot be found.
    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

    the data shld change to this
    identifier: 'name',
    items: [{
    name: 'www.google.com.sg',
    aisle: 'Mexican',
    price: 3.01
    },
    identifier: 'name',
    items: [{
    name: 'www.google.com.sg',
    aisle: 'Mexican',
    price: 3.01
    },
    or this
    identifier: 'name',
    items: [{
    name: 'http://www.google.com.sg',
    aisle: 'Mexican',
    price: 3.01
    },

    so you can work it out right, can you click on the link , is there any error?
    can show me how your code is like, cause i change the data but it give me this error above

  5. #30
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,678
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    There should be no need to make things as complex as in your sample.

    This is the list of items from before the link change:

    Code javascript:
    items: [{
        name: 'Adobo',
        aisle: 'Mexican',
        price: 3.01
    },
    {
        name: 'Balsamic vinegar',
        aisle: 'Condiments',
        price: 4.01
    },
    ...

    and this is the list of items with the added link:


    Code javascript:
    items: [{
        name: 'Adobo',
        link: 'http://www.adobo.com/',
        aisle: 'Mexican',
        price: 3.01
    },
    {
        name: 'Balsamic vinegar',
        link: 'http://www.balsalmic-vinegar.com/',
        aisle: 'Condiments',
        price: 4.01
    },
    ...
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  6. #31
    SitePoint Enthusiast
    Join Date
    Apr 2011
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    There should be no need to make things as complex as in your sample.

    This is the list of items from before the link change:

    Code javascript:
    items: [{
        name: 'Adobo',
        aisle: 'Mexican',
        price: 3.01
    },
    {
        name: 'Balsamic vinegar',
        aisle: 'Condiments',
        price: 4.01
    },
    ...

    and this is the list of items with the added link:


    Code javascript:
    items: [{
        name: 'Adobo',
        link: 'http://www.adobo.com/',
        aisle: 'Mexican',
        price: 3.01
    },
    {
        name: 'Balsamic vinegar',
        link: 'http://www.balsalmic-vinegar.com/',
        aisle: 'Condiments',
        price: 4.01
    },
    ...
    thanks alot!!!!done it...really appreciate your help
    can i ask you a question regarding create dummy html page using the json format
    i am wondering how can i put the json format data in the dummy html page?do you know?

  7. #32
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,678
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by cutexxbaby View Post
    thanks alot!!!!done it...really appreciate your help
    can i ask you a question regarding create dummy html page using the json format
    i am wondering how can i put the json format data in the dummy html page?do you know?
    You could display it on the HTML page in <pre> tags, if you wish to retain its formatting.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  8. #33
    SitePoint Enthusiast
    Join Date
    Apr 2011
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    You could display it on the HTML page in <pre> tags, if you wish to retain its formatting.
    meaning that like this:
    <pre>[ note
    {
    "id": "1",
    "title": "Family Dinner",
    "desc": "Get together for family dinner!"
    }
    ]</pre>
    then how will be output look like?
    cause this is the first time i have to use this way to retrieve the data
    this counted as javascript?

  9. #34
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,678
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by cutexxbaby View Post
    then how will be output look like?
    The output will retain the spaces that perform the indent.

    Quote Originally Posted by cutexxbaby View Post
    this counted as javascript?
    Nope, that is just HTML text. You may need to be more explicit about what you require.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  10. #35
    SitePoint Enthusiast
    Join Date
    Apr 2011
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so the json is html is somethin like this to show out the output ....
    <pre>[ note
    {
    "id": "1",
    "title": "Family Dinner",
    "desc": "Get together for family dinner!"
    }
    ]</pre>
    if i want the output
    1
    Family Dinner
    Get together for family dinner!

  11. #36
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,678
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by cutexxbaby View Post
    so the json is html is somethin like this to show out the output ....
    <pre>[ note
    {
    "id": "1",
    "title": "Family Dinner",
    "desc": "Get together for family dinner!"
    }
    ]</pre>
    if i want the output
    1
    Family Dinner
    Get together for family dinner!
    Are you wanting a pretty way to display the JSON content?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  12. #37
    SitePoint Enthusiast
    Join Date
    Apr 2011
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    Are you wanting a pretty way to display the JSON content?
    kind of...so how shld i put the json format into html?can show me an example

  13. #38
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,678
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by cutexxbaby View Post
    kind of...so how shld i put the json format into html?can show me an example
    I don't know of an easy way to do that. JSON data is a data interchange format, designed for passing data between different sub-systems, rather than for being displayed as visual content.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  14. #39
    SitePoint Enthusiast
    Join Date
    Apr 2011
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    I don't know of an easy way to do that. JSON data is a data interchange format, designed for passing data between different sub-systems, rather than for being displayed as visual content.
    so if i put as what you teach using <pre>
    something like this
    <pre>[ note
    {
    "id": "1",
    "title": "Family Dinner",
    "desc": "Get together for family dinner!"
    }
    ]</pre>
    so will the data still out?

  15. #40
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,678
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by cutexxbaby View Post
    so will the data still out?
    The data will be displayed on the page.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  16. #41
    SitePoint Enthusiast
    Join Date
    Apr 2011
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    The data will be displayed on the page.
    okay i try it out...thanks alot...

  17. #42
    SitePoint Enthusiast
    Join Date
    Apr 2011
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    There should be no need to make things as complex as in your sample.

    This is the list of items from before the link change:

    Code javascript:
    items: [{
        name: 'Adobo',
        aisle: 'Mexican',
        price: 3.01
    },
    {
        name: 'Balsamic vinegar',
        aisle: 'Condiments',
        price: 4.01
    },
    ...

    and this is the list of items with the added link:


    Code javascript:
    items: [{
        name: 'Adobo',
        link: 'http://www.adobo.com/',
        aisle: 'Mexican',
        price: 3.01
    },
    {
        name: 'Balsamic vinegar',
        link: 'http://www.balsalmic-vinegar.com/',
        aisle: 'Condiments',
        price: 4.01
    },
    ...
    hi sry to ask you again but
    when i show in the firefox there is a problem it don't display it out
    do you know what is the problem?

  18. #43
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,678
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by cutexxbaby View Post
    hi sry to ask you again but
    when i show in the firefox there is a problem it don't display it out
    do you know what is the problem?
    Can you provide a link to a test page that exhibits the problem?
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  19. #44
    SitePoint Enthusiast
    Join Date
    Apr 2011
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by paul_wilkins View Post
    Can you provide a link to a test page that exhibits the problem?
    is alright i kind of work it out...bt i want to ask you something...do you know how to do ajax

  20. #45
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,678
    Mentioned
    99 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by cutexxbaby View Post
    is alright i kind of work it out...bt i want to ask you something...do you know how to do ajax
    The best resource for rolling your own ajax is from a book called Bulletproof Ajax which also provides code and live examples

    It's a lot easier though to use a code library of some kind to manage the hard parts of ajax. If you don't want to use a library such as jQuery, there's a whole host of ajax micro-libraries to pick from.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript


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
  •