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
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.
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.