The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Print and Retrieve Javascript Object

Hello

let say with a javascript Object called linktarget it is made of a source-page with 4 to 5 links to targeted-pages that talk about the same topic than the source-page (you might have seen that already ).

i have an admin interface of let say some sort of a cms that let me play with every linktarget i.e. source-page and its targeted pages (so i can add or remove a target from a certain linktarget object) but the first thing i want to do is to display every LinkTarget object in the system (an array of targetlink object) so on my administration homepage i would have in a 2 columns table where every linktaget object occupies a single row where one cell contains info about the source-page and a second cell contains all the info about the targeted-pages linked to that source.

I am looking for help to write the function that access the object, retrieve the properties (source_url, source_title, source_date, source_category, target_title, target_date) and display them in the 2 columns html table i described described earlier...

Never. It works in a completely different way than all other javascript functions, and you always have alternatives. In ye old days it had greater support by browsers, so you could use it for making code more portable. This isn't an issue today though, so just stear clear of it.

thank you for this advice i will indeed stay away from document.write... it's just that in the project i do for my internship i actually have to take some of the code that was writen by the previous developper and it has a lot of document.write... well anyway i see that javascript is not a little toy for web developper it's actually a real language with its own complexities!

thank you indeed i wanted to use that syntax to define objects in my scripts... not sure of its usefulness hough but since json will be used as the data exchange formats in the app. we're building i thought it will be better to go on writing object in that format in the entire script