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. General Programming
  3. C / C++ / MFC
  4. java in c code?

java in c code?

Scheduled Pinned Locked Moved C / C++ / MFC
javahtmltoolstutorialquestion
5 Posts 3 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

    hi, 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 ;)

    I D 2 Replies Last reply
    0
    • P porac69

      hi, 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 ;)

      I Offline
      I Offline
      includeh10
      wrote on last edited by
      #2

      what do you mean about "work"? need Java code similar to your c code as bellow? String sBuf="

      1 Reply Last reply
      0
      • P porac69

        hi, 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 ;)

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        Define "does not work." How big is buffer? Don't the lines need to be terminated with a \n character so that it is output correctly.


        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

        P 1 Reply Last reply
        0
        • D David Crow

          Define "does not work." How big is buffer? Don't the lines need to be terminated with a \n character so that it is output correctly.


          "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

          P Offline
          P Offline
          porac69
          wrote on last edited by
          #4

          by doing this, the only thing that shows up on the web page is the top part of the page i created, then "It is now" and then on the following line is "variable status" but what i wanted it to do is after "It is now" it should show the correst date on the webpage. in powerpoint this javascript works. . . . strcat( buffer, " " "

          It is now " "<!--" "var currentTime = new Date();\r\n" "var day = currentTime.getDate();\r\n" "var month = currentTime.getMonth();\r\n" "var year = currentTime.getFullYear();\r\n" "document.write(day + / + month + / + year);\r\n" "

          \r\n" "

          VARIABLE STATUS

          " . . . thanks...;)

          D 1 Reply Last reply
          0
          • P porac69

            by doing this, the only thing that shows up on the web page is the top part of the page i created, then "It is now" and then on the following line is "variable status" but what i wanted it to do is after "It is now" it should show the correst date on the webpage. in powerpoint this javascript works. . . . strcat( buffer, " " "

            It is now " "<!--" "var currentTime = new Date();\r\n" "var day = currentTime.getDate();\r\n" "var month = currentTime.getMonth();\r\n" "var year = currentTime.getFullYear();\r\n" "document.write(day + / + month + / + year);\r\n" "

            \r\n" "

            VARIABLE STATUS

            " . . . thanks...;)

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Show me the relevant pieces of your code that create the HTML file and then write to it.


            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            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