Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

passing value from javascript to c

Status
Not open for further replies.

ALMIGHTY TECH

Member level 3
Member level 3
Joined
Jul 5, 2011
Messages
63
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Activity points
1,664
hello all friends..
i want to pass the value from javascript to c.

--------------------------------------------------------------
printf("<script type=\"text/javascript\">\n");

printf("function displayResult(n)\n");

printf("if (document.getElementById(n).value ==\"ON\")\n");
printf("{document.getElementById(n).value =\"OFF\";}\n");
printf("else {document.getElementById(n).value =\"ON\";}\n}");

printf("</script>\n");
-----------------------------------------------------------
i have used javascript in c. as you can see above..
now i want to pass the value from javascritp to c..

there is 'if' condition in javascript,
i want to assign value to c variable, if ('if' of javascript) condition become true ..

kidnly reply..
 

Hi,
The javascript will execute on the machine that is running the web browser, whereas I think any C code that you write you will wish to run on the web server,
right? If so, then your problem can be broken down to a need to transfer the result of the javascript execution to the server, via the network connection.
The conventional way to do this is to use (say) PHP running on the web server, and therefore PHP could execute a C program (and pass a parameter to your
C program), or alternatively use PHP to write to a file, which your C program can parse.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top