troubleshooting Question

jQuery: Ajax Response data location

Avatar of tikkdev
tikkdev asked on
JavaScriptjQuery
31 Comments1 Solution824 ViewsLast Modified:
Hi Guys,

I'm using jQuery to send data via POST and get a response, however the Response is echoed out in the div "#posting".

However, what i need is to write the response inside an embed tag etc, not sure how i wouuld do that... SEE CODE EXAMPLE.

I inserted "<----  COMMENT/TEXT HERE ETC.. ---->" so you can easily see what i'm talking about..

Looking forward to your ideas..
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>

<title>POST Testing</title>
<link href="facebox.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery-1.2.6.min.js"></script>
<link href="dependencies/screen.css" type="text/css" rel="stylesheet" />
<script src="jquery.elastic-1.6.js" type="text/javascript" charset="utf-8"></script>
<script src="jquery.watermarkinput.js" type="text/javascript"></script>
<script type="text/javascript">
	// <![CDATA[	
	$(document).ready(function(){	
	
		$('#shareButton').click(function(){
			var a = $("#watermark").val();
			$.post("postxml.php?text="+a, {
			}, function(response){
				$('#posting').html(unescape(response));
				$('#posting').fadeIn();
			});
		});	
		$('textarea').elastic();
		
		jQuery(function($){
		   $("#watermark").Watermark("Type in a Text");
		});
		jQuery(function($){
		   $("#watermark").Watermark("watermark","#369");
		});	
		function UseData(){
		   $.Watermark.HideAll();
		   //Do Stuff
		   $.Watermark.ShowAll();
		}
	});	
	// ]]>
</script>
<style>
</style>
</head>
<body>
<div align="center">
	<form action="" method="post" name="postForm">
	<div class="UIComposer_Box">
	<span class="w">
		<textarea class="input" id="watermark" name="watermark" cols="60">
		
		<---  HERE I TYPE IN THE POST DATA TEXT  --->
		
		</textarea>
	</span>
		<br clear="all" />
		<div align="right" style="height:30px; padding:10px 10px;">
			<label id="shareButton" class="uiButtonLarge uiButtonShare"> Send</label>
		</div>
	</div>
	</form>
	<br clear="all" />
	<div id="posting" align="center">
	
		<---  HERE IS THE POST DATA RESPONSE POSTED  --->
		
	</div>
	
	
	<embed type="application/x-shockwave-flash" src="http://www.google.com/reader/ui/3523697345-audio-player.swf" flashvars="audioUrl=
	
		<---  I NEED THE RESPONSE DATA HERE  --->
	
	" width="400" height="27" quality="best"></embed>
	
</div>
   
      </div>
</body>
</html>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 31 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 31 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros