#1678 posted by deqer on 2013/03/19 09:33:24
Although it's a bug and that it's being addressed, it's still too late.
Not many people will bother to upgrade their Chrome to latest version--we've seen that habit with IE users.
Simply adding several lines of javascript, and you'll be able to convert your "Post A Reply" < form > to use Ajax.
By looking at your HTML code, I can see that you are using javascript without any libraries such as mootools, jquery, etc. -- which is fine, you can still do ajax with plain javascript.
---
Just adjust your HTML slightly by adding an ID to the <td> that holds the "Post A Reply" form html.
Currently it is:
< td bgcolor="#333333" width="500" valign="top" >
< span class="header2">Post A Reply:</span >
...
< /td >
Change the < td > to have id="post-a-reply"
So, you then have < td bgcolor="#333333" width="500" valign="top" id="post-a-reply" >
Then, the javascript would be:
On submit:
var xmlhttp;
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else { // code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById("post-a-reply").innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("POST","http://celephais.net/board/view_thread.php?id=2&start=1676&ajax=1",true);
xmlhttp.send();
---
Notice I added another parameter "&ajax=1" to the submit URL, and you can use that in PHP to spit out a specific response for the update to the < td >, rather spit the entire page as if there was no ajax.
Obviously the "id=2&start=1676" part is dynamic, of course.
#1679 posted by deqer on 2013/03/19 09:35:04
Hmm, that one line got garbled. It changed my quotation character to "&quo..." Let's try again:
xmlhttp.open("POST", "http://celephais.net/board/view_thread.php?id=2&start=1676&ajax=1" ,true);
Ahhh, whatever.
#1680 posted by Spirit on 2013/03/19 10:09:28
Chrome updates automatically.
Yup
Deqer, this is a veey change-averse group ;-)
#1682 posted by deqer on 2013/03/19 16:45:14
Still doesn't hurt to add some ajax to the site. Ajax has been available and supported for 10+ years now. Saves on resources, too.
It's 2013. Get with it.
Metl
#1683 posted by Spirit on 2013/03/19 16:49:14
Please don't. Javascript is bloody annoying.
Yes
Please don't, and it's not necessary at all. You can protect against double posts entirely on the server.
#1685 posted by rj on 2013/03/19 18:50:56
Please don't. Javascript is bloody annoying.
uhm.. javascript is used already?
#1686 posted by metlslime on 2013/03/19 19:28:03
I do have plans for ajax, in fact it's already used for the "flag spam" feature that moderators have. But this site is not my active project right now (aside from necessary maintenance.)And don't worry, I would only use it for enhancements that make sense for the design of the site.
#1687 posted by deqer on 2013/03/19 20:03:37
Yeah, better not let a stranger like me tell you how to improve your outdated website. Best you figure it out on your own. Maybe another 10 years, and you'll come around.
Yo Deqer
#1688 posted by Spirit on 2013/03/19 20:07:59
if you are not listening to the many people who give you helpful advice, then why should they listen to you.
#1689 posted by JneeraZ on 2013/03/20 00:09:42
He's gone critical! He's gonna blow!
I knew it wouldn't last. Awesome.
Deqer
#1690 posted by RickyT33 on 2013/03/20 14:29:51
Welcome to the OLD SKOOL!!!
Also Deqer
#1691 posted by RickyT33 on 2013/03/20 14:32:42
Thanks for the lesson in AJAX btw. Seriously. That looks like useful info for a cat like me (deadly serious), please re-post the truncated line again, just add a space after .celephais.net/board .
And
#1692 posted by RickyT33 on 2013/03/20 14:33:36
ActiveXObject("Microsoft.XMLH...
Actually
#1693 posted by Kinn on 2013/03/20 16:08:13
If you could use some fancy javascript/ajax/jibberty-jello magic to make it so Deqer's posts are ignored that would be great thanks :)
#1694 posted by JneeraZ on 2013/03/20 17:50:54
Or just install vBulletin.
*ducks*
So I Heard U Likes JQuery?
#1695 posted by Spiney on 2013/03/25 16:11:34
Feature Suggestion
#1696 posted by negke on 2013/03/25 19:01:52
A link to display all posts from within a thread. I know it can be done by clicking on the title, but it's not very transparent and, well, I keep forgetting. Would fit well with the current navigation: All | First | Previous | Next | Last.
Don't Go
#1697 posted by ijed on 2013/03/26 02:58:21
For the crown Kinn.
#1698 posted by - on 2013/03/27 01:28:05
test test
#1699 posted by - on 2013/03/27 01:28:06
test test
#1700 posted by - on 2013/03/27 01:29:01
repro on double posting in Firefox:
Write post.
Press Preview.
Hit submit rapidly on the preview page.
Random Request: OpenID?
#1701 posted by Tyrann on 2013/04/04 10:20:29
@metlslime: how hard do you think it might be to make func an OpenID provider, so that we could use our func_msgboard accounts to log into other sites? Then people could use their func personas to post comments on my site (instead of creating a local login) or possibly quakewiki.org could hook into it as well?
Tyrann:
#1702 posted by metlslime on 2013/04/04 21:26:58
I don't know, I actually have never looked into it.
|