Web Analytics Made Easy -
StatCounter HTML code as input for a function - CodingForum

Announcement

Collapse
No announcement yet.

HTML code as input for a function

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • HTML code as input for a function

    Hi everyone,
    I hashing algorithm for that i need to send html source page as input using javascript.
    Can anyone help in writing the code for that?

    My project is authenticity of a website!
    here after opening a webpage a user can get addon and by clicking in the tools menu the the present html page should be sent as an input for the hashing function.I am stuck up at this point.Someone help?
    thanks in advance...

  • #2
    I'm not 100% sure what you're asking but if you want to have the user copy/paste in html source code and then have that code sent via a form to another page, you can do so easily with the textarea element:
    Code:
    <form action="handle_html.php" method="post">
    	<textarea name="html_code"></textarea><br />
    	<input type="submit" value="send html code" />
    </form>
    If you're wanting to grab a page's source code on the fly, then you can do so via AJAX. If the control page doesn't lie within the same domain as page being ajaxed you will need a simple server-side API to retrieve it for you.
    Feel free to e-mail me if I forget to respond ;)
    [email protected]

    Comment


    • #3
      hey

      Hey i need to send the html source code of the current webpage but i don't want it be sent using a form.
      I need to send the html source code using javascript to a function.
      I am building a addon for that the code should be sent and the coding should be using javascript.
      so please send how to send the html source code to a function...Using JAVASCRIPT...
      Last edited by pradeepjfu; Apr 9, 2009, 11:39 AM.

      Comment


      • #4
        Originally posted by pradeepjfu View Post
        Hey i need to send the html source code but i don't want it be sent using a form.
        I need to send the html source code using javascript to function.
        I am building a addon for that the code should be sent using javascript.
        soo please send how to send the html source code to function...Using JAVASCRIPT...
        Several questions arise... first, what do you mean by 'send the html source code'? Like gather the entire website and send it to another website or some-such? If not, I'm guessing you will be using some sort of input fields, gathering their values and sending an AJAX request to another location... which in turn can be done with JavaScript... but there's really not much of a point in doing so, considering a simple form will do exactly the same thing. Unless of course you have pagination with dynamic content, in which case you'll need to store cookies or, or, or... feh, the possibilities are limit-less. Try and be a bit more descriptive in regards to exactly what you are trying to accomplish. I for one can't understand what you're trying to do, not sure itsallkizza did either. Now, I understand that English might not be your native language, but... if we can't understand what you want... we can't help you.
        The way to success is to assume that there are no impossible things. After all, if you think something is impossible, you will not even try to do it.

        How to ask smart questions?

        Comment


        • #5
          clear explanatio....

          I need to send the html source code of the webpage as input for a function.
          I need this code to be written using javascript.


          (I am doing a project called authenticity of a website.Here i am designing a addon for firefox where user by clicking a option in the browser can check whether the site is legal or not whole process takes place on client system itself. in this i am using hashing algorithm.)

          now for this i need a javascript function which returns the html source code( of the current website that is opened in the browser).So that i can use the returned html source code as input for the hash algorithm that i have.
          Last edited by pradeepjfu; Apr 9, 2009, 11:54 AM.

          Comment


          • #6
            It would be more efficient to simply send the url of the current page to your validator, then have your server grab that url's source code on its own, validate it, then return it's response.
            Feel free to e-mail me if I forget to respond ;)
            [email protected]

            Comment


            • #7
              hi

              The URL will be changing as the redirection of the URL takes place.
              So i am using source code as input.Also we are told to do so...
              So please anyone can help...?

              Comment


              • #8
                Originally posted by pradeepjfu View Post
                The URL will be changing as the redirection of the URL takes place.
                So i am using source code as input.Also we are told to do so...
                So please anyone can help...?
                You are told to do so? Is this a homework assignment? If so, I doubt a whole lot of people would be interested in providing a fully functional code as assistance. The point of homework is for you to learn something new. Post your own code(if you have one that isn't working as expected) and we will provide advice on what to do to solve that issue.
                The way to success is to assume that there are no impossible things. After all, if you think something is impossible, you will not even try to do it.

                How to ask smart questions?

                Comment


                • #9
                  Just wanted to second that: I'm about 10 times more willing to help with more complete code if this isn't a homework assignment. A, because you should be doing most of the work yourself (it is your homework after all) and b, because I'm not a fan of someone asking how to do something in a faulty way and then refusing an improved alternative.

                  If you want to lay out an assignment for someone to do for you with specific limitations then at least do so in the Web Projects and Services section and offer some sort of compensation.
                  Feel free to e-mail me if I forget to respond ;)
                  [email protected]

                  Comment


                  • #10
                    hey its not actually a home work or assignment....
                    Me and my friend trying to design a plug-in we divided the task....
                    He told he can't get that one so i posted this.....
                    If u can help please help us.....
                    its just a simple plug-in development.....
                    that's set.....

                    Comment


                    • #11
                      So then...
                      It would be more efficient to simply send the url of the current page to your validator, then have your server grab that url's source code on its own, validate it, then return it's response.
                      This is easy to do.
                      Feel free to e-mail me if I forget to respond ;)
                      [email protected]

                      Comment

                      Working...
                      X