File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes viewing and sending back to server javascript created HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "viewing and sending back to server javascript created HTML" Watch "viewing and sending back to server javascript created HTML" New topic
Author

viewing and sending back to server javascript created HTML

marten kay
Ranch Hand

Joined: Feb 03, 2007
Posts: 178

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


when in doubt put it in parenthesis and stick a dollar sign in front of it, only good can come from this.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61768
    
  67

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).


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
marten kay
Ranch Hand

Joined: Feb 03, 2007
Posts: 178

Thanks Bear

shove the markup into a hidden field


what is a hidden field in this case?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

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.


GenRocket - Experts at Building Test Data
marten kay
Ranch Hand

Joined: Feb 03, 2007
Posts: 178

OK thanks

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

Cheers
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: viewing and sending back to server javascript created HTML