f



JavaScript?

I have a question, and I hope this one hasn't been asked too frequently; if 
so, I apologize in advance.

I've heard over time that it isn't a good idea to intermingle JavaScript 
with PHP code.  Maybe that's a fallacy, and maybe not, but if so, would 
someone care to enlighten me as to why this might be the case?

Thanks in advance for any responses.

-- 
Randy Jackson
http://fourcolorexplosion.com
0
7/10/2004 4:32:43 PM
comp.lang.php 32646 articles. 0 followers. Post Follow

2 Replies
727 Views

Similar Articles

[PageSpeed] 44

On Sat, 10 Jul 2004 16:32:43 GMT, Randy Jackson
<randyjackson@ignorethispartfourcolorexplosion.com> wrote:

>I have a question, and I hope this one hasn't been asked too frequently; if 
>so, I apologize in advance.
>
>I've heard over time that it isn't a good idea to intermingle JavaScript 
>with PHP code.  Maybe that's a fallacy, and maybe not, but if so, would 
>someone care to enlighten me as to why this might be the case?

 Well, you can't intermingle the two, since they won't run on the same machine
anyway.

 What you can do is output Javascript source code from PHP for execution by the
browser.

 What you shouldn't do is _rely_ on that Javascript to do anything, such as
validation or filling in fields, since you don't have any control over the
remote environment.

--
Andy Hassall <andy@andyh.co.uk> / Space: disk usage analysis tool
http://www.andyh.co.uk         / http://www.andyhsoftware.co.uk/space
0
andy171 (2271)
7/10/2004 4:47:23 PM
"Randy Jackson" <randyjackson@ignorethispartfourcolorexplosion.com> wrote in
message news:Xns952275F6E703Frandyjacksonfourcolo@206.141.193.32...
> I have a question, and I hope this one hasn't been asked too frequently;
if
> so, I apologize in advance.
>
> I've heard over time that it isn't a good idea to intermingle JavaScript
> with PHP code.  Maybe that's a fallacy, and maybe not, but if so, would
> someone care to enlighten me as to why this might be the case?
>
> Thanks in advance for any responses.
>
> -- 
> Randy Jackson
> http://fourcolorexplosion.com

It just gets really confusing, that's all. Slashes can get totally out of
control when you have Javascript code sitting inside a PHP string. Here's an
extreme case:

echo "var re = new RegExp('\\\\\\\\', 'g');";

All the thing does is look for one backslash.


0
chernyshevsky (2297)
7/11/2004 5:57:22 AM
Reply:

Similar Artilces:

Use PHP var in PHP generated Javascript?
I know the common way of using a PHP variable in javascript via: <script>myjsvar = <?echo $phpvar;?>;</script> But in my case I'm generating several javascript code blocks (which produce some flash) via a PHP loop, so I need to figure out another way to get the PHP vars into these blocks similar to: foreach ($lines as $line) { print "<script>myjsvar = $phpvar;</script>"; } I've tried various ways to get this working included ".$phpvar." and "+ $phpvar+", etc. None seem to work. There has to be a way to make this work. Any suggestions? Thanks, Max On Jan 1, 6:03=A0pm, Max <m...@kipness.com> wrote: > I know the common way of using a PHP variable in javascript via: > > <script>myjsvar =3D <?echo $phpvar;?>;</script> > > But in my case I'm generating several javascript code blocks (which > produce some flash) via a PHP loop, so I need to figure out another > way to get the PHP vars into these blocks similar to: > > foreach ($lines as $line) { > > =A0 =A0 =A0print "<script>myjsvar =3D $phpvar;</script>"; > > } > > I've tried various ways to get this working included ".$phpvar." and "+ > $phpvar+", etc. None seem to work. There has to be a way to make this > work. > > Any suggestions? > > Thanks, > Max Wouldn't print "<script>myjsvar =3D {$phpvar}...

javascript and php
can javascript communicate with php forms? wesley@ispace.co.za wrote: > can javascript communicate with php forms? Well, once the form is out on the browser it is no longer "php", it is simply HTML and so the answer is yes. ...

PHP or Javascript for this?
I'm wanting to create an hyperlink that will execute a mysql_query and then refresh the current page if it's clicked on. I've similar things created via javascript but didn't know if such was possible with PHP. You could do it like --- <? if (isset($_GET['q']) && $_GET['q']=='y') { mysql_query(...); header("Location: ?"); } echo "<a href='?q=y'>Execute Query</a>"; ?> --- However, using this technique all the GET-variables would be cleared. Also, I personally would use two PHP-Files, if you don't need to use the returned data from the query in the first script: --- file1.php <? echo "<a href='query.php'>Execute Query</a>"; ?> --- file2.php <? mysql_query(...); [Do sth.] header("Location: file1.php"); ?> --- Akhenaten schrieb: > I'm wanting to create an hyperlink that will execute a mysql_query and > then refresh the current page if it's clicked on. I've similar things > created via javascript but didn't know if such was possible with PHP. > On May 20, 3:23 pm, Philipp Grassl <p.gra...@gmx.at> wrote: > You could do it like > > --- > <? > > if (isset($_GET['q']) && $_GET['q']=='y') > { > mysql_query(...); > header("Location: ?"); > > } > > echo "<a href='?q=y'>...

Javascript and PHP ?
Hi everybody !! I am just wondering if Javascript and PHP can interact with each other ? Let's say i have a variable in Javascript ( call it "var x = 6;") Is there anyway that we can use "x" value (which is 6) in PHP code? (let's say I want to print "x" out in PHP script) In general, can Javascript variables interact with PHP code and vice versa ? Thank you in advance !! PS: My initial thought is this: "It is impossible to do !" Prove me wrong ==> :) Jay wrote: > I am just wondering if Javascript and PHP can interact with each other > > Let's say i have a variable in Javascript ( call it "var x = 6;") > Is there anyway that we can use "x" value (which is 6) in PHP code? > (let's say I want to print "x" out in PHP script) > > In general, can Javascript variables interact with PHP code and vice > versa ? Javascript is a client-side technology. PHP is a server-sided technology. You can write out Javascript using PHP and you can post stuff in web forms and using GET URLs back to the server which can then be processed by PHP. In your example, you would need to assign the "x" variable to a hidden form value so it's actually posted back to the server, which PHP would then be able to use. There is no way for PHP to access Javascript variables, other than them being submitted in a form, modifying the form's post property or redirecting to an...

JavaScript to PHP
Over the years I have written a number of JavaScript. The past couple of years I have been rewriting a few in PHP. I do not have any good PHP reference material. Can someone help me out. What would I replace Math.POW with? ans1 = c7 + c8 + c9 + c10 + c11 c12 = ( Math.pow(10.0, ans1)) Thanks, Stan Stan Weiss wrote: > Over the years I have written a number of JavaScript. The past couple of > years I have been rewriting a few in PHP. I do not have any good PHP > reference material. Well, you can use the PHP manual.[1] > Can someone help me out. What would I replace > Math.POW with? > > ans1 = c7 + c8 + c9 + c10 + c11 > c12 = ( Math.pow(10.0, ans1)) Just use the pow() function.[2] Since PHP 5.6 there's even an operator (**) available.[3] [1] <http://www.php.net/manual/> [1] <http://www.php.net/manual/function.pow.php> [2] <https://wiki.php.net/rfc/pow-operator> -- Christoph M. Becker Christoph Michael Becker wrote: > Stan Weiss wrote: >> Can someone help me out. What would I replace >> Math.POW with? >> >> ans1 = c7 + c8 + c9 + c10 + c11 >> c12 = ( Math.pow(10.0, ans1)) > > Just use the pow() function.[2] Since PHP 5.6 there's even an operator > (**) available.[3] The latest stable PHP version is 5.5.9. [1] PHP 5.6.0*alpha2* was released on 2014-02-13. [2] It is not a good idea to spe...

JavaScript and PHP
Hi, How can I get a Javascript var into PHP, on the SAME PAGE. I would like to get the value of a Javascript var (like document.myForm.f_name.value) to treat it in PHP. Many Thanx, Jay, France. *** Jay wrote/escribi� (Fri, 26 Nov 2004 12:37:35 +0100): > How can I get a Javascript var into PHP, on the SAME PAGE. > > I would like to get the value of a Javascript var (like > document.myForm.f_name.value) to treat it in PHP. PHP is executed first and in a different computer, you can't go back. What's your exact need? -- -- �lvaro G. Vicario - Burgos, Spain -- Thank you for not e-mailing me your questions -- Jay <firststep@easynet.fr> wrote in message news:<41a7154d$0$3748$afc38c87@news.easynet.fr>... > Hi, > How can I get a Javascript var into PHP, on the SAME PAGE. > > I would like to get the value of a Javascript var (like > document.myForm.f_name.value) to treat it in PHP. You have a form, why not to submit it? In any way, you can send data from JavaScript (client) to PHP (server) via GET or POST request. Alvaro G Vicario <alvaro_QUITAR_REMOVE@telecomputeronline.com> wrote in message news:<15w03h95c47ly.1k8eqaydh06yn.dlg@40tude.net>... > *** Jay wrote/escribi� (Fri, 26 Nov 2004 12:37:35 +0100): > > How can I get a Javascript var into PHP, on the SAME PAGE. > > > > I would like to get the value of a Javascript var (like > > document.myForm.f_name.value) to treat it in PHP. >...

PHP and Javascript
Hello there, I have the folowing problem: I need to use the <body onload="loadMenu()";"initDocument()"> but the first javascript "loadMenu()" is in menu.php and initDucument() is in content.php. Now Non of these php files has a body tag in order to add the onload Javascritp because I use a header.php and a footer.php which is included in each php document. I succesfully use the <body onload="loadMenu()"> in my header.php but if I add the initDocument(). It won't work.... Does any of you ever did something similar and is able to give me a hint ? "Angelos" <angelos@redcatmedia.net> wrote in news:d5vgu6$3lj$1@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com: > Hello there, > I have the folowing problem: > I need to use the <body onload="loadMenu()";"initDocument()"> but the > first javascript "loadMenu()" is in menu.php and initDucument() is in > content.php. > > Now Non of these php files has a body tag in order to add the onload > Javascritp because I use a header.php and a footer.php which is > included in each php document. > > I succesfully use the <body onload="loadMenu()"> in my header.php but > if I add the initDocument(). It won't work.... > > Does any of you ever did something similar and is able to give me a > hint ? > > > > what exactly doesn't work? let's suppos...

JavaScript to PHP?
I was just wondering that if it is possible to do almost anything you can do in JavaScript in PHP. The Numerator wrote: > I was just wondering that if it is possible to do almost anything you > can do in JavaScript in PHP. Off the top of my head, I would say no. Because in my opinion, one of the most important essences of javascript is the dynamic DOM manipulation, which PHP can not do. The Numerator wrote: > I was just wondering that if it is possible to do almost anything you > can do in JavaScript in PHP. Are you referring to server-side or client-side Javascript? &quo...

php with javascript
Hello i have this script echo " <a href=\"javascript:openCentered('re.php?betaling=$betaling&persemail=$email&logid=$logid&id=$id&reactie=yes&logoproep=$logoproep&persoproep=$persoproep&date=$date&logemail=$logemail','codes','480','230','scrollbar=yes')\" OnMouseOver=\"window.status='IndoDutchMatching!'; return true;\" OnMouseDown=\"window.status='IndoDutchMatching'; return true;\" OnMouseOut=\"window.status='IndoDutchMatching'; return true...

about php lang
plz told me that what is the php lang., how does it works and where it used. mani <msb.jod@gmail.com> wrote: > plz told me that what is the php lang., how does it works and where it > used. There is a good explanation at http://lmgtfy.com/?q=php regards Henrik -- The address in the header is only to prevent spam. My real address is: hc3(at)poolhem.se Examples of addresses which go to spammers: root@localhost postmaster@localhost On 16 Jun 2009, mani <msb.jod@gmail.com> wrote: > plz told me that what is the php lang., how does it works and > where it used. Lulz. <http://www.google.com/> -- ~Curtis Anonymous (1984 IOCCC winner): int i;main(){for(;i["]<i;++i){--i;}"];read('-'-'-',i+++"hell\ o, world!\n",'/'/'/'));}read(j,i,p){write(j/p+p,i---j,i/i);} mani schreef: > plz told me that what is the php lang., how does it works and where it > used. http://en.wikipedia.org/wiki/Php Tip: If you want to learn something about a subject totally new to you, try wikipedia for a reasonable intro. Regards, Erwin Moller -- "There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." -- C.A.R. Hoare ...

php in javascript
I have create a checkbox,call getS function in onclick event. I append value of variable output with value $text. It works well but when I changed value of $text to a paragraph of text, it will occur error on the page. Please advise. Thanks. <script language = "javascript"> <?php $text = "testing"; ?> function getS (id){ var output = ""; if (document.getElementById("id").checked) { output = output + <? echo $text; ?> ; }} </script> You need to learn about the request resonse model. php is run to produce html(& javascript) which is then sent to the browser. The broser then runs the html (& javascript). So your code will be delivered to the browser as <script language = "javascript"> function getS (id){ var output = ""; if (document.getElementById("id").checked) { output = output + testing ; // <- error testing is not a variable. }} </script> Fletch wrote: >You need to learn about the request resonse >model. php is run to >produce html(& javascript) which is then sent >to the browser. The >broser then runs the html (& javascript). So >your code will be >delivered to the browser as ><script language = "javascript"> >function getS (id){ >var output = ""; >if (document.getElementById("id").checked) >{ > output = output + testing ; // <- error >testing is not a ...

PHP and/or Javascript
Hi, I was wondering if anyone knows of a way to test if javascript is on with PHP or any other language. I need to test if it is enabled and if it isnt, redirect to another page. Any help greatly appreciated. Cheers Will willl69 wrote: > Hi, > > I was wondering if anyone knows of a way to test if javascript is on > with PHP or any other language. I need to test if it is enabled and > if it isnt, redirect to another page. Any help greatly appreciated. Only Javascript can test if Javascript is enabled. Given that, you would be much better off asking this in comp.lang.javascript Actually, you would be even better off searching the forum first, since this exact question has been discussed at least twice in the past month. There were a few decent solutions proposed - you could take your pick! -- Tony Garcia Web Right! Development Hi Will, If you want to test if Javascript is on in your browser make a file called test.html with the following <html> <head> </head> <body> <p> <script language="javascript" type="text/javascript"> <!-- document.write("javascript is enabled in your browser. In your browser preferences try turning javascript off and reload this page.") // --> </script> <noscript> javascript and is not enabled in your browser. In your browser preferences try turning javascript on and reload this page. </noscript> </p> </body> </htm...

PHP and Javascript
Hello all, I know this more a javascript rather than a php problem, but i searched internet and couldn't find an answer. Here it is : I simply want to know how to open a "Open File" or "Save File" box, after clicking an html button. I'm sure it's a three-lines-of-code problem :) Which class implements this ? Thank you very much Ismael In article <c5075d7d.0402220940.5c0c3883@posting.google.com>, ismael@club-internet.fr says... > Hello all, > > I know this more a javascript rather than a php problem, > but i searched internet and couldn&...

Validate your html forms with javascript and php with a simple php class
I found this article today, it shows how to valide your forms with both javascript and php by just using a php class http://www.codeassembly.com/Validate-your-html-forms-with-javascript-and-php-with-a-simple-php-class-that-generates-everything/ __ meinte: > I found this article today, it shows how to valide your forms with > both javascript and php by just using a php class > [snip] And your question is? Anyway, pretty bad code quality. Gregor -- http://www.gregorkofler.at ::: Landschafts- und Reisefotografie http://www.licht-blick.at ::: Forum f�r Multivisionsvortr�ge htt...

PHP to JavaScript
How do I send a variable, $validity from php and use it in JavaScript? Seem like PHP is written first, then html and JavaScript. Is it possible? Ken On Sat, 4 Sep 2004 21:16:41 -0500, "Ken" <kkrolski@wi.rr.com> wrote: >How do I send a variable, $validity from php and use it in JavaScript? > >Seem like PHP is written first, then html and JavaScript. > >Is it possible? > >Ken > They're 2 separate technologies. PHP is server-side and Javascript, client-side. One option maybe to write the JS with PHP: <?php $phpFoo = 'bar'; echo '<script type="text/javascript">'; echo " alert('$phpFoo');"; echo '</script>'; ?> Haven't tried this personally, but I don't know of any other method that might work. HTH =) Regards, Ian -- Ian.H digiServ Network London, UK http://digiserv.net/ "Ken" wrote: > How do I send a variable, $validity from php and use it in JavaScript? > > Seem like PHP is written first, then html and JavaScript. > > Is it possible? > > Ken Basically php is creating an html/javascript page, so you just use php to write out the javascript code based on the logic of your php code. Hope that answers. -- http://www.dbForumz.com/ This article was posted by author's request Articles individually checked for conformance to usenet standards Topic URL: http://www.dbForumz.com/PHP-Java...

php generated html needs simple javascript function, yet my javascript sux
Greetings all - im new to this newsgroup so pls dont flame me :p I need some help! Please view the html below in a browser. Or goto this url -> http://firebrain.co.uk/java-problem.htm (Assuming you have seen the rendered code) Basically I need the X buttons to change all the values of each textbox to zero either in the col or row depending on which button is clicked. Function summery: If you click on a X button on the right hand side of the table it resets all the textboxes in that row. And if you click one of the X buttons along the base of the table it will reset all the textfields in the column. I hope the way I named my fields can be for>looped in javascript :) If you have not seen the HTML in a browser yet please do so because im sure there is a very easy solution to my problem. Please please please - this is for a client and im running low on time Any help would be much appreciated! Any questions just ask Please reply to this message or (preferably) send me an email to javascript@firebrain.co.uk Thank you -------------------------------------- <form name='availability'> <p><table cellpadding=3> <tr> <td rowspan=2 valign=bottom id='greybg'><b>Dates</b></td> <td colspan=5 id='purpbg'><b>Building One</b></td> <td colspan=3 id='purp2bg'><b>Building Two</b></td> </tr> <tr> <td id='purpbg' valign=top style=...

How do you write this Javascript in PHP?
How do I code the following Javascript to run in a PHP script? ------------------------- <script type="text/javascript" language="javascript"> // function passfile1path() { var path = document.processPictures.userfile1.value; document.processPictures.file1path.value = path; } </script> <form...> <input type=file name="userfile1" onfocus="passfile1path();" size=90 maxlength=2000000 accept="image/jpeg" tabindex=1> <input type=hidden name=file1path> </form> ------------------------- Just when I think I'm getting to know a little bit about PHP, I run into another stumbling block. Thanks for your help. Don ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= East/West-Coast Server Farms - Total Privacy via Encryption =--- Don wrote: > How do I code the following Javascript to run in a PHP script? > > ------------------------- > <script type="text/javascript" language="javascript"> > // > function passfile1path() > { > var path = document.processPictures.userfile1.value; > document.processPictures.file1path.value = path; > } > </script> > > <form...> > <input type=file name="userfile1" onfocus="passfile1path();" size=90 > maxlength=2000000 accept="image/jpe...

PHP and Javascript #3
I have PHP 5 installed on my windows machine. I have a drop down menu that requires javascript. When I call <?php include "filename.php" ?> and rename my html file to .php, the Javascript doesn't run on the client. Is there some sort of setting required? Maybe a bug in php? Any information would be helpful. french_roast@sbcglobal.net wrote: > I have PHP 5 installed on my windows machine. I have a drop down menu > that requires javascript. When I call <?php include "filename.php" ?> > and rename my html file to .php, the Javascript doesn't run on the > client. Is there some sort of setting required? Maybe a bug in php? > Any information would be helpful. To be hones, i don't exactly know what you mean, but let me tell you: PHP and JS are two very different things. PHP gets executed after the server recieved the request. It then sends you a plain HTML document. In that HTML document, the browser looks for initiation of JavaScripts. So, if a javascript is not executed, this means you have something wrong in your HTML or JavaScript code. It has nothing to do with PHP. Try pasting your scripts. fsidler@nospam.gmail wrote: > french_roast@sbcglobal.net wrote: > > I have PHP 5 installed on my windows machine. I have a drop down menu > > that requires javascript. When I call <?php include "filename.php" ?> > > and rename my html file to .php, the Javascript doesn't run o...

javascript and php #2
function switchColors(element, color) { links=document.getElementsByTagName("a") ; for (var i = 0 ; i < links.length ; i ++) links.item(i).style.color = 'blue' ; element.style.color=color ; } I have an echo php link with a javascript mouseout, why doesnt this work? <a href=\"$PHP_SELF?action=list_records&amp;cur_page=$varray&id=$id\" onmouseout=javascript:switchColors(this, 'yellow')> $array </a></td>"; Irlan Irlan agous wrote: > I have an echo php link with a javascript mouseout, why doesnt this work? > > <a href=3D\"$PHP_SELF?action=3Dlist_records&amp;cur_page=3D$varray&id=3D$id\" > onmouseout=3Djavascript:switchColors(this, 'yellow')> $array </a></td>"; Perhaps a couple reasons - try this: onmouseout=3D"switchCo=ADlors(this, 'yellow')" (no javascript: and the onmouseout value is in quotes Its not working, i tried it. I get the error message Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /home/httpd/resultaattest.php on line 196 "BKDotCom" <bkfake-google@yahoo.com> schreef in bericht news:1116173076.199935.136320@g14g2000cwa.googlegroups.com... Irlan agous wrote: > I have an echo php link with a javascript mouseout, why doesnt this work? > > <a href=\"$PHP_SELF?action=list_records&amp;cur_page=$varray&id=$id\" >...

php within javascript
For a photo display I am using a javascript I found on the net (freeware). The Java script code has to be placed within head and /head tags The Java code consists of the start <script language="JavaScript1.2"> Then about 150 lines of script followed by values I have to write in and then about another 150 lines of Java script before the </script> The values I have to write in are the names of the files in this format Pic[0] = 'img/2005/horiz/image0.jpg' Pic[1] = 'img/2005/horiz/image1.jpg' Pic[2] = 'img/2005/horiz/image2.jpg' Pic[3] = 'img/2005/horiz/image3.jpg' I have placed these in a php file and I use Include from the middle of the java script to call these in. It works fine for these four files As I have 3600 lines to write I would like to use a php echo to write the lines into the java script. Something along the lines of <? i=0; While ($i<3601){ echo "Pic["; echo $i; echo"] = 'img/2005/horiz/image"; echo $i; echo ".jpg'"; i++; } ?> But it does not work and I have played around with the syntax and tried varying methods. Is this because Java script does not like too much php code and its conflicting. Or should I be able to use php code freely from within the Java script and I have simply created a php syntax error. The page fails to load. Checking the source code in MSIE reveals that it stops working in the middle of the Java when it comes to the php code...

php and javascript #2
Hi, Is there any particular reason why JavaScript included in php include page does not work? Will this be a browser security issue? It works with FireFox, but not with IE, which I suppose supports the browser security argument. I've found it is a general JavaScript problem, but an example is: <?php /*snip*/ echo "<img src='../images/go.jpg' onclick='javascript:document.search_form.submit()' alt='go' style='margin-left: .2em; vertical-align: top; '>"; /*snip*/ ?> There are other ways to use an image as a submit button, I realise, and maybe I should just ditch the JavaScript, but it is an unexpected problem. Many thanks JB "Joe Blow" <Joe@Blow.com> wrote in message news:uMnme.482$Id.400@read1.cgocable.net... > Hi, > > Is there any particular reason why JavaScript included in php include page > does not work? Will this be a browser security issue? It works with > FireFox, but not with IE, which I suppose supports the browser security > argument. > > I've found it is a general JavaScript problem, but an example is: > > <?php > > /*snip*/ > echo "<img src='../images/go.jpg' > onclick='javascript:document.search_form.submit()' alt='go' > style='margin-left: .2em; vertical-align: top; '>"; > /*snip*/ > ?> > > There are other ways to use an image as a submit button, I realise,...

javascript and php form
hi everyone, this is not exactly php question, but I need to call javascript inside php script. now the question: <form name="myForm".... <tr><td><select name="mySelect" onChange="recreate(myForm)"... where recreate represent javascript function: function recreate(form) { var input=document.form.mySelect.value; ... } how can I create new objects inside myForm depending on mySelect value ? (I know how to enable them but it's more elegant to display them based on previous selection inside mySelect) thx. @net wrote: > hi everyone, > > this is not exactly php question, but I need to call javascript inside > php script. now the question: > > <form name="myForm".... > <tr><td><select name="mySelect" onChange="recreate(myForm)"... > > where recreate represent javascript function: > > function recreate(form) > { > var input=document.form.mySelect.value; > > ... > } > > how can I create new objects inside myForm depending on mySelect value > ? (I know how to enable them but it's more elegant to display them > based on previous selection inside mySelect) > > thx. > > You have to do it all within the Javascript - recreate() - based on the value of MySelect. You can use Php to build the JavaScript function(s) / object(s), so all possible combinations are already within the source of the page, b...

Ajax and Javascript with PHP
Hi friends, I have to parse a XML file and when it is changed I need to change in the front end. If I use the settimeout() then it is working. But I don't what to use the settimeout() function. Is there any other way to do that? On Oct 6, 6:22=A0pm, lak <lakindi...@gmail.com> wrote: > Hi friends, > I have to parse a XML file and when it is changed I need to change in > the front end. > If I use the settimeout() then it is working. > But I don't what to use the settimeout() function. > > Is there any other way to do that? It will bettre if ur write your question little descriptive. So that we can try to answer it. -------------------------------------------- http://phpinterviewanswers.blogspot.com/ On Oct 7, 1:10 pm, Rider <shaha...@gmail.com> wrote: > On Oct 6, 6:22 pm, lak <lakindi...@gmail.com> wrote: > > > Hi friends, > > I have to parse a XML file and when it is changed I need to change in > > the front end. > > If I use the settimeout() then it is working. > > But I don't what to use the settimeout() function. > > > Is there any other way to do that? > > It will bettre if ur write your question little descriptive. > So that we can try to answer it. > > --------------------------------------------http://phpinterviewanswers.blogspot.com/ I am having an XML file that contains some records. I need to parse that file and display the records in the form of tabl...

PHP variables in javascript ?
Am I being a bit dense again? How do I use variables created in PHP with javascript? tony tony@tony.com wrote: > Am I being a bit dense again? > How do I use variables created in PHP with javascript? Echo them in a script block to the HTML. $variable = 'something'; echo <<<JS <script type="text/javascript"> var myVar = '$variable'; </script> JS; Grtz, -- Rik Wasmus Is this what you mean??? eg. <body onload="alert('<?php echo $php_variable; ?>')"> Thanks pieter and rick... both useful to me. If there are other ways I'd be happy to see them too. thanks tony ...

php n javascript
Hi I have a problem while inserting php code into javascript var danevar1 = '<?php echo $dane1; ?>'; this line doesn't work i tried also: var danevar1 = '<? echo $dane1; ?>'; and var danevar1 = '<?= echo $dane1; ?>'; but it's not working Can anyone help my with it? Leszek Leszek wrote: > Hi > I have a problem while inserting php code into javascript > > var danevar1 = '<?php echo $dane1; ?>'; > > this line doesn't work > i tried also: > var danevar1 = '<? echo $dane1; ?>'; > and > var danevar1 = '<?= echo $dane1; ?>'; > > but it's not working > What do you expect it to do? All you have done is create a string. -- Ian Collins. Leszek wrote: > Hi > I have a problem while inserting php code into javascript > > var danevar1 = '<?php echo $dane1; ?>'; > > this line doesn't work > i tried also: > var danevar1 = '<? echo $dane1; ?>'; > and > var danevar1 = '<?= echo $dane1; ?>'; > > but it's not working > > Can anyone help my with it? > Leszek > > are you define $dane prior to sending the header containing the javascript? Simple test... ---------cut here---------------- <?php $dane = "123";?> <html> <head> <script type="text/javascript?> function xyz(a){ var='<? echo $dane; ...

Web resources about - JavaScript? - comp.lang.php

JavaScript Kit- Your comprehensive JavaScript, DHTML, CSS, and Ajax stop
Your comprehensive JavaScript, DHTML, CSS, and Ajax stop

Let's Code: Test-Driven Javascript by James Shore — Kickstarter
James Shore is raising funds for Let's Code: Test-Driven Javascript on Kickstarter! A screencast series focusing on rigorous, professional Javascript ...

Eloquent JavaScript: A Modern Introduction to Programming
... and pragmatics. I loved the tutorial-style game-like program development. This book rekindled my earliest joys of programming. Plus, JavaScript! ...

JavaScript - Wikipedia, the free encyclopedia
programming styles. JavaScript was formalized in the ECMAScript language standard and is primarily used in the form of client-side JavaScript ...

Open Directory - Computers: Programming: Languages: JavaScript: Tools: Obfuscators
... editor - report abuse/spam - help the entire directory only in Tools/Obfuscators Description Top : Computers : Programming : Languages : JavaScript ...

Facebook File-Transfer App Pipe Relaunches, Now Works Via JavaScript, WebRTC
... allowed Facebook users to send and receive files up to 1 gigabit in size. A new version of Pipe debuted Monday, and the app now works via JavaScript ...

Under the Hood: The JavaScript SDK - The use of polyfills - Facebook
Facebook Engineering hat eine Notiz mit dem Titel Under the Hood: The JavaScript SDK - The use of polyfills geschrieben. Du kannst den vollständigen ...

JavaScript
The Facebook SDK for JavaScript provides a rich set of client-side functionality for adding Social Plugins, making API calls and implementing ...

Senior Front-End Developer (Javascript and AJAX)
Company: Sometrics Category: Software Development Location: Los Angeles, CA How to Apply: jobs@sometrics.com Description: We are looking for ...

Badass JavaScript (@badass_js) on Twitter
WebGLWorker is an open source library that allows using WebGL from Web Workers. Great work as always from @kripken . blog.mozilla.org/research/2014/… ...

Resources last updated: 3/24/2016 4:08:02 AM