What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Is there a way to include (in PHP) with javascript?

Pages: (2): « First [ 1 ] 2 » Last »
Is there a way to include (in PHP) with javascript?
Author: Message:
Art Crazy
Full Member
***

Avatar
WTH is "ENTER" anyway?

Posts: 133
Reputation: 2
– / Male / –
Joined: Jul 2003
O.P. Is there a way to include (in PHP) with javascript?
Is there a way to include something in a page like <?php include "bla";?> but in java script?
[Image: ArtCrazy.jpg]
05-27-2004 08:20 PM
Profile E-Mail PM Find Quote Report
Banks
Full Member
***

Avatar

Posts: 178
Reputation: 1
36 / Male / –
Joined: Feb 2003
RE: Is there a way to include (in PHP) with javascript?
include will take another file and basically act as if it was part of that page, so if you have a .js file yes, but i don't see why you wouldn't just use <script src="">
05-27-2004 08:31 PM
Profile E-Mail PM Find Quote Report
Art Crazy
Full Member
***

Avatar
WTH is "ENTER" anyway?

Posts: 133
Reputation: 2
– / Male / –
Joined: Jul 2003
O.P. RE: Is there a way to include (in PHP) with javascript?
Sry but i know a little about coding.
how do i use <script src="">???
[Image: ArtCrazy.jpg]
05-27-2004 08:33 PM
Profile E-Mail PM Find Quote Report
lhunath
Full Member
***

Avatar
.{ Lord Daisy }.

Posts: 343
40 / Male / –
Joined: May 2004
RE: Is there a way to include (in PHP) with javascript?
<script src="[uri-to-javascript-file]" />

Like, say you have some javascript in a file called MyJava.js
then you write
<script src="MyJava.js" language="javascript" type="text/javascript" />
And when the browser arrives at this line, it will parse the content of the javascript file refered to.

(Edit: added language/type attributes)

This post was edited on 05-27-2004 at 08:41 PM by lhunath.
{ -[Image: lhunath.gif]- }
05-27-2004 08:37 PM
Profile E-Mail PM Web Find Quote Report
Art Crazy
Full Member
***

Avatar
WTH is "ENTER" anyway?

Posts: 133
Reputation: 2
– / Male / –
Joined: Jul 2003
O.P. RE: Is there a way to include (in PHP) with javascript?
Ok thanks, now could u help me making an php or shtml file with include for a file named news.php?
If u explained me how to do one working..
mine doesnt work..
[Image: ArtCrazy.jpg]
05-27-2004 08:40 PM
Profile E-Mail PM Find Quote Report
lhunath
Full Member
***

Avatar
.{ Lord Daisy }.

Posts: 343
40 / Male / –
Joined: May 2004
RE: Is there a way to include (in PHP) with javascript?
quote:
Originally posted by Art Crazy
Ok thanks, now could u help me making an php or shtml file with include for a file named news.php?
If u explained me how to do one working..
mine doesnt work..
Mind asking what you want me to do rather than pointing at a library and asking me to get me 'that' book for you.... ? If you get what I mean =)

Including is easy, as long as your server supports PHP.
add <?php include "[uri-to-file]"; ?> in your document. Make sure it has the extension .php instead of .html or so.. and you're ready. (Mind, it'll only run on the server, if it supports PHP, it won't work in your own pc if you preview it without uploading..)
{ -[Image: lhunath.gif]- }
05-27-2004 08:50 PM
Profile E-Mail PM Web Find Quote Report
lylesback2
Veteran Member
*****

Avatar
[lylesback2]

Posts: 1786
Reputation: 1
39 / Male / –
Joined: Jan 2003
Status: Away
RE: Is there a way to include (in PHP) with javascript?
<?
include("javafile.html")
?>
<skanky>lylesback2</lanky>
3 days, 4 hours, 2 minutes, 56 seconds till the end of the world

05-27-2004 10:36 PM
Profile PM Web Find Quote Report
Guido
Elite Member
*****

Avatar
Design is Safety

Posts: 4566
Reputation: 50
37 / Male / Flag
Joined: Dec 2002
RE: Is there a way to include (in PHP) with javascript?
quote:
Originally posted by lhunath
Make sure it has the extension .php instead of .html or so
Just to clarify, that's for the file where you place the include() code, the included file can be of any extension and it will be parsed as if it were a .php NO MATTER WHAT EXTENSION IT HAS.

This post was edited on 05-27-2004 at 10:57 PM by Guido.
05-27-2004 10:54 PM
Profile E-Mail PM Web Find Quote Report
lizard.boy
Veteran Member
*****

Avatar

Posts: 1708
Reputation: 24
34 / Male / Flag
Joined: Mar 2003
RE: Is there a way to include (in PHP) with javascript?
exactly what guido said. i did this thing using dynamic css using an include and a file with css in it with variables lol.
05-28-2004 01:21 AM
Profile E-Mail PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Is there a way to include (in PHP) with javascript?
quote:
Originally posted by lhunath
<script src="[uri-to-javascript-file]" />
Loose the "/" at the end, that is NOT valid html!!! That should only be used when you have a XHTML page...
.-= A 'frrrrrrrituurrr' for Wacky =-.
05-28-2004 10:08 AM
Profile PM Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On