JavaScript, reading from a file and opening links.

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
Lethality
Forum Newbie
Posts: 16
Joined: Tue May 01, 2007 9:38 am

JavaScript, reading from a file and opening links.

Post by Lethality »

I have a logfile on the server and I want to be able to open it with a javascript, go through all the links and open them in separate tabs in the browser. Is this possible?

The links are stored as an array like this (php stored):

Code: Select all

Array
(
    [0] => http://www.randomsite.domain
    [1] => www.randomsite.domain
    [2] => http://randomsite.domain
)
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

on the server? Then you'll want to make an ajax call and parse the file yourself (though you'll need to print the array as text, hint: JSON)
Lethality
Forum Newbie
Posts: 16
Joined: Tue May 01, 2007 9:38 am

Post by Lethality »

Kieran Huggins wrote:on the server? Then you'll want to make an ajax call and parse the file yourself (though you'll need to print the array as text, hint: JSON)
Any suggestions on how to do that? (I'm pretty new to coding)
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

hmmm... sounds like a job for (a few) tutorials!

Check out jQuery's ajax methods and the php man page for json_encode() - that should get you well on your way.
Post Reply