Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

viewing and sending back to server javascript created HTML

 
marten kay
Ranch Hand
Posts: 178
Java jQuery Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am creating a little web-based application that involves creating bits of HTML interactively using javascript, using methods such as createElement,className, setAttribute etc.

Two questions,
1) what is best way have a 'look' at the HTML code created

2) what is the best way to send this back to server, or, how do I pack a javascript created HTML fragment into a XHTMLHttpRequest.

Any clear pointers here would be much appreciated.

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64830
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Firebug

2) You want to send HTML markup to the server? Odd. In any case, shove the markup into a hidden field and submit it as part of a form submission (easy to do with jQuery and its form plugin).
 
marten kay
Ranch Hand
Posts: 178
Java jQuery Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear

shove the markup into a hidden field


what is a hidden field in this case?
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by marten kay:
Thanks Bear



what is a hidden field in this case?


The same as it is in any case; an input element of type hidden.
 
marten kay
Ranch Hand
Posts: 178
Java jQuery Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK thanks

Not quite getting it, another learning curve and book purchase coming up.

Cheers
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic