This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's Calculator Programming subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. General Coding and Design => Calculator Programming
Author Message
Brazucs
I have no idea what my avatar is.


Super Elite (Last Title)


Joined: 31 Mar 2004
Posts: 3349

Posted: 04 Nov 2005 02:51:20 pm    Post subject:

Simple question (probably dumb too):
Can I have javascript in a .php page, perhaps along with some PHP code?


Last edited by Guest on 04 Nov 2005 02:56:34 pm; edited 1 time in total
Back to top
leofox
INF student


Super Elite (Last Title)


Joined: 11 Apr 2004
Posts: 3562

Posted: 04 Nov 2005 02:53:21 pm    Post subject:

I suppose you can use HTML in php right? Maybe you can use JS in the HTML?
Back to top
Brazucs
I have no idea what my avatar is.


Super Elite (Last Title)


Joined: 31 Mar 2004
Posts: 3349

Posted: 04 Nov 2005 02:56:49 pm    Post subject:

Hmm... perhaps. Would it be somthing like:

Code:
<?php echo '<p>Hello World</p>'; ?>
 <javascript> function () { dump("Hello World"); }, </javascript>

or maybe

Code:
<?php echo '<javascript> function () { dump("Hello World"); }, </javascript>'; ?>

?


Last edited by Guest on 04 Nov 2005 03:02:43 pm; edited 1 time in total
Back to top
leofox
INF student


Super Elite (Last Title)


Joined: 11 Apr 2004
Posts: 3562

Posted: 04 Nov 2005 02:59:28 pm    Post subject:

Y'know, i havent coded any HTML for 6 months at least, and i dont know PHP or JS. Just try it is my advice.
Back to top
Brazucs
I have no idea what my avatar is.


Super Elite (Last Title)


Joined: 31 Mar 2004
Posts: 3349

Posted: 04 Nov 2005 03:01:18 pm    Post subject:

I'm away from a codable computer right now: they barely let you save stuff.
I guess I'll try it when I get home :\
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 04 Nov 2005 03:12:58 pm    Post subject:

I don't see how integration of both would be difficult.
I mean, can't JavaScript produce PHP and vice versa?

(I'm not an expert on both.)
Back to top
Brazucs
I have no idea what my avatar is.


Super Elite (Last Title)


Joined: 31 Mar 2004
Posts: 3349

Posted: 04 Nov 2005 03:22:08 pm    Post subject:

From what I know, HTML and PHP are symbiotic (couldn't find a better word) as long as your server supports it. Ditto for HTML and JS.

I just don't know if JS would work on, say, example.php.
Back to top
Arcane Wizard
`semi-hippie`


Super Elite (Last Title)


Joined: 02 Jun 2003
Posts: 8993

Posted: 04 Nov 2005 03:25:16 pm    Post subject:

Javascript is client sided, so no it can not create and run php code.

PHP is used to echo HTML responses to a client browser. You can echo html, javascript, anything you want, and if the browser understands it it'll work.

<?php
echo "<script language=\"javascript\">alert(\"Javascript echoed by PHP!\");</script>";
?>

The page will contain

<script language="javascript">alert("Javascript echoed by PHP!");</script>

and will be read as such by the client's browser.


Last edited by Guest on 04 Nov 2005 03:27:22 pm; edited 1 time in total
Back to top
Brazucs
I have no idea what my avatar is.


Super Elite (Last Title)


Joined: 31 Mar 2004
Posts: 3349

Posted: 04 Nov 2005 03:29:42 pm    Post subject:

Niiice... so I might be able to make it work. [mystery] Dum Dum Duuuuum [/mystery]

Last edited by Guest on 04 Nov 2005 03:32:04 pm; edited 1 time in total
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement