Welcome Guest, Not a member yet? Register   Sign In
Javascript file needs to POST
#1

[eluser]spmckee[/eluser]
Greetings,

I have a JS file that sends info to a PHP file at the root level of my site. I got this working on my live site but I had to do some hacking and , to be honest, don't remember how I did it.

So I have rebuilt the site on my Dev server and am trying to do it the "right" way this time.

The JS file is trying to send this:
Code:
make_slides.php first_last_buttons=no&first_slide_is_intro=no&hover_next_prev_buttons=yes&next_prev_buttons=yes&pause_button=no&slide_buttons=no&slide_captions=no&slide;_directory=/images/slides&doctype=html&slide_links=no&slide_number_display=no&water_mark=no

but it never gets generated.

I did make sure to include "make_slides\.php" to my .htaccess exclusion list.

Any ideas?
Thanks!
#2

[eluser]slowgary[/eluser]
I would use jQuery. It makes ajax easy.
Code:
<script type='text/javascript'src='http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js'></script>
<script type='text/javascript'>
     $.post('make_slides.php', {
            first_last_buttons: 'no',
            first_slide_is_intro: 'no',
            hover_next_prev_buttons: 'yes',
            next_prev_buttons: 'yes',
            pause_buttons: 'no',
            tacos: 'yes_please',
            slide_captions: 'no',
            slide_directory: '/images/slides',
            slide_links: 'no',
            slide_number_display: 'no',
            doctype: 'html',
            water_mark: 'no'
     });
</script>




Theme © iAndrew 2016 - Forum software by © MyBB