SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2010
    Location
    Israel
    Posts
    523
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    replacing content in div

    hello everyone,
    i want to have on my page a div where content changes when ppl click on certain links without a full page reload
    when searching i've popped up on many similar examples (one of them is this: http://www.willmaster.com/library/we...iv-content.php

    however i find it hard to manage because the content that being replaced is dynamic, big and may have many speical symbols like " or ' which makes the script stop working immediately

    Does any1 got any good solution to this?
    thanks.

  2. #2
    Non-Member Max Height's Avatar
    Join Date
    Dec 2011
    Posts
    303
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    If the content is dynamic, then depending on how it is generated you could use ajax.

  3. #3
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,702
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    If you want to load the content from separate html pages, the People code examples from Bulletproof Ajax do a nice job of things.

    Similar techniques can be applied if you want to retrieve the content via a php page, so that it can customize or or retrieve the content from your database.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  4. #4
    SitePoint Evangelist
    Join Date
    Jun 2010
    Location
    Israel
    Posts
    523
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    i'm not loading the content from different pages its loaded directly from db
    i need something small (and simple) like the thing i've posted in the first post, but something that will not cause problems when symbols are used (specially " or ') because the content is dynamic and i dont know when and where such symbols will be used, so i need a script that will take care of that.

    thanks for the help.


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
  •