LOLWesta, a social media forum


You are not connected. Please login or register

View previous topic View next topic Go down Message [Page 1 of 1]

1
Append submitted data Empty Append submitted data Tue Sep 23, 2014 8:32 am

Test Account


Members
Members
Hello there.

My question is, how can I append submitted data at some page? I'll work with PHP and Javascript's CORS since I want it to appears at my forum.

Here is my code :

Javascript :

Code:
(function($, w, r) {
w = w.substr(w.indexOf("/") + 1);
if (!r.test(w)) return;
$.post('form.php', {
TID : w.substr(w.indexOf("form") + 1, w.indexOf("s") - 1),
formPost : encodeURIComponent($('.post').html())
    }).done(function() {
        console.log('Data successfully transferred.');
    }).fail(function() {
        console.log('Failed to send data. Please contact the system administrator if this error persists.');
    });
})(jQuery, window.location.pathname, /\d+/);

PHP code is ongoing.

2
Append submitted data Empty Re: Append submitted data Tue Sep 23, 2014 10:44 am

LOLWesta


LOLWesta King
Wait.

The JavaScript is pretty similar into the JavaScript in this forum; JavaScript CORS that will get the current unique ID of the topic. It's the uncompressed one, and it's already modified so it won't looks alike. Well I'll just uncompressed it at jsbeautifier and yes the printed result looks very similar into your code. I spend so much time to create the script. And yes you're spending some time, but you're just converting it and re-write it. Or maybe, modified it. And it spend your time for less from one minute.

Anyway, back to the topic. Why not use AJAX for it? It's more simple, and more easy to code.

https://lolwesta.forumotion.com

3
Append submitted data Empty Re: Append submitted data Wed Dec 24, 2014 11:34 am

Tsu


Members
Members
With this, I believe.

Code:
$(document).ready(function() {
$('#submitbutton').click(function(e) {
var datacmprs = $('#datacmprs');
datacmprs.find('input[name="action"]').val($this.data("action"));
datacmprs.submit();
});
});

Just some random script I'll found in the internet. .

4
Append submitted data Empty Re: Append submitted data Sat Jan 17, 2015 11:36 am

Left


Members
Members
Try accessing the script.php with jQuery.get method and get the value.

Something like this (don't do so, it's just an example) :

Code:
$(function() {
$.get('script.php', function(data) {
$(this).val();
});
});

Sponsored content


View previous topic View next topic Back to top Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum