Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1929 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

JavaScript feeds

Thread title: JavaScript feeds
Closed Thread  
Page 1 of 2 1 2 >
    Thread tools Search this thread Display Modes  
06-02-2005, 07:25 PM
#1
Bas is offline Bas
Status: I love this place
Join date: Jan 2005
Location: The Netherlands
Expertise: Frontend, vBulletin
Software: Coda, Photoshop
 
Posts: 607
iTrader: -1 / 0%
 

Bas is on a distinguished road

Send a message via MSN to Bas

  Old  JavaScript feeds

I made this file that generates feeds with JavaScript and PHP, simular to what W3Reports uses.

The file is called feed.php for now and when I view it I see this:
Code:
document.write('<a target="_blank" href="http://localhost/tutorial/7/a-design-tutorial/">A design tutorial :)</a><br />');
document.write('<a target="_blank" href="http://localhost/tutorial/6/a-design-tutorial/">A design tutorial :)</a><br />');
document.write('<a target="_blank" href="http://localhost/tutorial/5/some-tutorial-that-teaches-you-the-basics-of-php/">Some tutorial that teaches you the basics of PHP</a><br />');
document.write('<a target="_blank" href="http://localhost/tutorial/4/Tutorial test yada-yada/">Tutorial test yada-yada</a><br />');
document.write('<a target="_blank" href="http://localhost/tutorial/3/3-column-layout-with-divs/">3 Column layout with divs</a><br />');

document.write("<br />Tutorials by <a href="http://www.xamer.net" title="Visit Xamer">Xamer</a>");
Which is good.

Now to include it on a page I'll have to use code like this:
Code:
<script src="http://localhost/feed.php" type="text/javascript"></script>
Nothing's showing up on my page though, does anyone know why this is happening?

06-03-2005, 03:11 PM
#2
Bas is offline Bas
Status: I love this place
Join date: Jan 2005
Location: The Netherlands
Expertise: Frontend, vBulletin
Software: Coda, Photoshop
 
Posts: 607
iTrader: -1 / 0%
 

Bas is on a distinguished road

Send a message via MSN to Bas

  Old

11 views in almost 24 hours ..

No one?

06-03-2005, 05:55 PM
#3
Jonny is offline Jonny
Status: Member
Join date: Feb 2005
Location: UK
Expertise:
Software:
 
Posts: 335
iTrader: 0 / 0%
 

Jonny is on a distinguished road

  Old

As far as I can tell, it should work.

Tried removing the space between the document.write's?

06-03-2005, 08:18 PM
#4
Aphex is offline Aphex
Aphex's Avatar
Status: Member
Join date: Aug 2004
Location: United States
Expertise:
Software:
 
Posts: 244
iTrader: 0 / 0%
 

Aphex is on a distinguished road

Send a message via AIM to Aphex Send a message via MSN to Aphex

  Old

A link to the actual site where it is used might be useful.

When you say you see the javascript "document.write...", do you see this when you goto the PHP page (parse it), or when you include the script to a page (in the way you showed us)?

06-03-2005, 08:44 PM
#5
Bas is offline Bas
Status: I love this place
Join date: Jan 2005
Location: The Netherlands
Expertise: Frontend, vBulletin
Software: Coda, Photoshop
 
Posts: 607
iTrader: -1 / 0%
 

Bas is on a distinguished road

Send a message via MSN to Bas

  Old

I just realized I used " for the last rule instead of '

Thanks for responding all

06-11-2005, 09:06 AM
#6
drewrockshard is offline drewrockshard
drewrockshard's Avatar
Status: I'm new around here
Join date: Jun 2005
Location: Dallas, TX
Expertise:
Software:
 
Posts: 8
iTrader: 0 / 0%
 

drewrockshard is on a distinguished road

Send a message via AIM to drewrockshard Send a message via MSN to drewrockshard Send a message via Yahoo to drewrockshard

  Old

if you named it "feed.php", the server is going to see it as "php"...so i think ure problem lies in the original program. you forgot the opening/closing tags of php, so it should read:
Code:
<?php
document.write('<a target="_blank" href="http://localhost/tutorial/7/a-design-tutorial/">A design tutorial :)</a><br />');
document.write('<a target="_blank" href="http://localhost/tutorial/6/a-design-tutorial/">A design tutorial :)</a><br />');
document.write('<a target="_blank" href="http://localhost/tutorial/5/some-tutorial-that-teaches-you-the-basics-of-php/">Some tutorial that teaches you the basics of PHP</a><br />');
document.write('<a target="_blank" href="http://localhost/tutorial/4/Tutorial test yada-yada/">Tutorial test yada-yada</a><br />');
document.write('<a target="_blank" href="http://localhost/tutorial/3/3-column-layout-with-divs/">3 Column layout with divs</a><br />');

document.write("<br />Tutorials by <a href="http://www.xamer.net" title="Visit Xamer">Xamer</a>");
?>
hope this helps, if not, keep posting.

06-11-2005, 10:39 AM
#7
Jonny is offline Jonny
Status: Member
Join date: Feb 2005
Location: UK
Expertise:
Software:
 
Posts: 335
iTrader: 0 / 0%
 

Jonny is on a distinguished road

  Old

But then you would have to write "echo 'document...';"

Its fixed now anyway.

06-11-2005, 11:29 AM
#8
Bas is offline Bas
Status: I love this place
Join date: Jan 2005
Location: The Netherlands
Expertise: Frontend, vBulletin
Software: Coda, Photoshop
 
Posts: 607
iTrader: -1 / 0%
 

Bas is on a distinguished road

Send a message via MSN to Bas

  Old

Hey drew
It is PHP, I just posted the outcome of when I view the file in my browser.

06-11-2005, 06:38 PM
#9
drewrockshard is offline drewrockshard
drewrockshard's Avatar
Status: I'm new around here
Join date: Jun 2005
Location: Dallas, TX
Expertise:
Software:
 
Posts: 8
iTrader: 0 / 0%
 

drewrockshard is on a distinguished road

Send a message via AIM to drewrockshard Send a message via MSN to drewrockshard Send a message via Yahoo to drewrockshard

  Old

Originally Posted by Bas
Hey drew
It is PHP, I just posted the outcome of when I view the file in my browser.
whats up bas.

the thing is though, if you really put the code above it (the one you wrote, not the one i did), then that really isnt php. all you did was name it a php document, but it was all javascript. so you really wrote a javascript program, not a php program.

06-11-2005, 07:06 PM
#10
Dave is offline Dave
Dave's Avatar
Status: Member
Join date: Jan 2005
Location: Warrington, England
Expertise:
Software:
 
Posts: 285
iTrader: 0 / 0%
 

Dave is on a distinguished road

Send a message via AIM to Dave Send a message via MSN to Dave

  Old

He means he put all of the code you put into it, but because he had an error in his code, when viewing the actual document it actually displayed that section of code from feed.php. It didnt display the <?php and echo's, just them lines, instead of actually putting them to use.


I think.

Closed Thread  
Page 1 of 2 1 2 >


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed