Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. html and java in c?

html and java in c?

Scheduled Pinned Locked Moved Web Development
javahtmltoolstutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    porac69
    wrote on last edited by
    #1

    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 ;) ***

    C 1 Reply Last reply
    0
    • P porac69

      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 ;) ***

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups