Forums / Cotonti / Extensions / AJAX parts in plugs

urlkiller
#24282 2010-04-23 10:58
yeah thanks for the tipps

iam using firebug as debugger woirking smooth.

my problem was the x i was sending it 2 times... ;( one in a hidden input (as default) and one as jquery var. i fixed that now...

@trustmaster

as i understand it the $("input[name=x]").val() is deprecated since 1.1.4 or so... it should be: $("input[@name=x]").val()

;)

{PHP.sys.xk} this is really helpful...

Added 7 minutes later:

btw i solved it more like the tut was:
but i did the changes to plug.php and the other file and i still get kicked onto the error page in the background (i see the updates after my POST request i get message.php?msg=950 ! BUT get not redirected and stay on the form part of my testsite). seems like some sort of wierd problem...
		$t->assign('MY_JS_FUNC', "$(document).ready(function(){
			timestamp = 0;
			updateMsg();
			$(\"form#myform\").submit(function(){
				$.post(\"plug.php?r=dashboard\",{
							message: $(\"#sendmessage\").val(),
							group_id: $(\"#group_id\").val(),
							user_id: $(\"#user_id\").val(),
							x: \"".sed_sourcekey()."\",
							user_name: $(\"#user_name\").val(),
							user_avatar: $(\"#user_avatar\").val(),
							action: \"send\",
							time: timestamp
						}, function(xml) {
								addMessages(xml);
								$('#sendmessage').val('');
				});
				return false;
			});
		});");

Added 41 seconds later:

above the highlighter bar seems broken when mixing code and the highlight tag ;)
URL shortener: <a href="http://bbm.li/!7AD5C7">http://bbm.li/!7AD5C7</a>
This post was edited by urlkiller (2010-04-23 11:08, 14 years ago)