Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-28-2012, 03:30 AM   PM User | #1
JohnSlider
New Coder

 
Join Date: Mar 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
JohnSlider is an unknown quantity at this point
Bypass AJAX Button

I use Zetaboards forum and I wanted a javascript that would use AJAX to hide the fast reply box and put in the form for the full reply box (with smileys, BBCode, etc). Someone posted this:

Code:
<script type='text/javascript'>
if(/\/topic\//.test(location.href)){
var rplybtn = $('#fast-reply button:contains(Full Reply Screen),.topic-buttons a:has(img[alt=Add Reply])');
rplybtn.click(function(){
var url = main_url+'post/?mode=2&type=1&f='+$('input[name=f]:first').attr('value')+'&t='+location.href.split("topic/")[1].split("/")[0], text = $('#fast-reply textarea').val();
$.get(url, function(q){
$('#fast-reply').replaceWith($('form[name=posting]',q).clone());
$('#c_post-text').val(text);
$('#btn_preview').click(Preview)
});
if($(this).is('button')){return false;};
}).filter('a').attr('href','#copyright');
};
</script>
This code does that via a button. The users have to press a button that says "Full Reply Screen" in order for the script to replace the quick reply box with the full reply box, but I want to remove the button aspect and just have the replacement happen automatically on every page. Any idea what I would need to do to the above code for that to happen?
JohnSlider is offline   Reply With Quote
Old 02-28-2012, 01:37 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,498
Thanks: 18
Thanked 361 Times in 360 Posts
sunfighter is on a distinguished road
If your going to do it without giving the user control over it, just write it that way to begin with. Why show 'em something no-one is going to use????
sunfighter is offline   Reply With Quote
Old 02-28-2012, 03:48 PM   PM User | #3
JohnSlider
New Coder

 
Join Date: Mar 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
JohnSlider is an unknown quantity at this point
I did not write the original code.
JohnSlider is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:59 PM.


Advertisement
Log in to turn off these ads.