html and java in c?
-
well, does any one know how to put a small java script code (about 10 lines) into a c code script? what i am doing is creating a web page (by putting html in the c code) and it works but now i want to add java in and it does not work. i thought it was like this: strcat( buffer, "
It is now " "<!--" "var currentTime = new Date()" "var day = currentTime.getDate()" "var month = currentTime.getMonth()" "var year = currentTime.getFullYear()" "document.write(day + / + month + / + year)" "
" ); any suggestions? thanks ;) ***
-
well, does any one know how to put a small java script code (about 10 lines) into a c code script? what i am doing is creating a web page (by putting html in the c code) and it works but now i want to add java in and it does not work. i thought it was like this: strcat( buffer, "
It is now " "<!--" "var currentTime = new Date()" "var day = currentTime.getDate()" "var month = currentTime.getMonth()" "var year = currentTime.getFullYear()" "document.write(day + / + month + / + year)" "
" ); any suggestions? thanks ;) ***
Doesn't Javascript need semi-colons to terminate statements. Your string reads: It is now <!--var currentTime = new Date()var day = currentTime.getDate()var month = currentTime.getMonth()var year = currentTime.getFullYear()document.write(day + / + month + / + year) The javascript parser is probably getting confused because all the statements run into each other. Also, you didn't terminate the comment that is there so that browsers that don't support javascript can ignore the javascript code.