0

I'm wanting to develop a "Report a Bug" feature. Is it possible for a user to submit a form that essentially contains the HTML on a page?

Let's say there's something strange on the page that the user wants to report. I would have a text box area where they could say, "_ doesn't look right. Can you look into it?" Then the form would submit that comment AND the HTML of what they were seeing on their end.

Thoughts?

gtilflm
  • 1,389
  • 1
  • 21
  • 51
  • It's possible, but it's often enough not going to be terribly useful. What if the problem has nothing to do with the HTML at all? (JavaScript error, an external resource like an image or CSS file that didn't load for the user...) Also, you won't see the rendered page behind the HTML so all you'd have is some code to stare at – Pekka Jun 12 '13 at 17:38
  • ...or if they are using a different browser, OS, etc. This question is not appropriate for StackOverflow though, since you just asking for general feedback on your idea. – woz Jun 12 '13 at 17:39
  • Just out of curiosity, why don't you just let your user to submit comment along with the URL of the page. – Armaiti Jun 12 '13 at 17:42
  • @ Aramiti: Because the page content changes upon refresh and new page loads. @ woz: No, it is appropriate because I'm asking about functionality. – gtilflm Jun 12 '13 at 17:57
  • http://www.barklund.org/blog/2009/10/14/how-snapabug-works/ breaks down how http://snapengage.com/ takes webpage screenshots for bug reports. It might be worth a look. –  Jun 12 '13 at 18:05

1 Answers1

0
var markup = document.documentElement.innerHTML;
alert(markup);

From How to get the entire document HTML as a string?

Set Markup to the some hidden form element and submit it with the rest of the page

Community
  • 1
  • 1
Nick
  • 3,217
  • 5
  • 30
  • 42