Results 1 to 5 of 5
  1. #1

    Question Need help with jQuery... It doesn't $.post or load files from a folder...

    I'm runnning a XAMPP localhost on Mac OS X...

    The script I have created is to load more content from a MySQL database when the user scrolls to the bottom...

    I have a .php page that is supposed to load more content through a jQuery $.post and load request and if I have that file inside htdocs, it works fine... But I'm gonna be creating more of those files and want to put them inside a folder in htdocs... Now it doesn't work...

    This works perfectly... I have the load.php file inside htdocs:
    $("#div").load("load.php",{"number":variable},function(){variable++;});

    Now when I created a folder inside of htdocs "content" and set all file permissions to read & write and placed load.php inside it, it doesn't work:
    $("#div").load("content/load.php",{"number":variable},function(){variable++;});

    I've also tried:
    $("#div").load("http://localhost/content/load.php",{"number":variable},function(){variable++;});
    and it also doesn't work

    "Inspect Element" in Firefox showed a 500 Internal Server Error for the file...
    I restarted my computer and XAMPP and also doesn't work...

    Anyone have any idea how I can solve this?

  2. #2
    Join Date
    Feb 2012
    Posts
    62
    Quote Originally Posted by GreenCat29 View Post
    500 Internal Server Error
    Have your tried accessing the file just in your web browser? Does it say internal server error? When moving the file to a new directory if it has any paths in it did you update it to reflect where it is now? Try making a static .html file with some filler text and see if that works.
    Hosting Boss - Providing you with quality service at a great price!
    Offering: SSD/Cloud Shared Hosting and Dedicated Servers
    █ Its time for up time, sign up today!

  3. #3

    Question

    Quote Originally Posted by HostingBossWeb View Post
    Have your tried accessing the file just in your web browser? Does it say internal server error? When moving the file to a new directory if it has any paths in it did you update it to reflect where it is now? Try making a static .html file with some filler text and see if that works.
    Yup. Just did it. jQuery appended those 3 p tags I have in an html file inside a folder no problem... Then I put the PHP file in the folder and changed the path and it doesn't work... Do .php files only work in htdocs?

    Update: I remove everything in the PHP file in the folder and just used <?php echo "Text"; ?> and jQuery also appended that... All I have is a basic script that uses a $_POST variable to retreive data from a database... Then I add in the script piece by piece and echo some text and it displays no problem until I start querying the database... Seems like I can't do any prepared statements querying?
    Last edited by GreenCat29; 11-23-2014 at 07:44 PM.

  4. #4
    Join Date
    Feb 2012
    Posts
    62
    Does your php file include another file? Is there any variables being sent to the php file? If you can post code that would help.
    Hosting Boss - Providing you with quality service at a great price!
    Offering: SSD/Cloud Shared Hosting and Dedicated Servers
    █ Its time for up time, sign up today!

  5. #5
    Quote Originally Posted by HostingBossWeb View Post
    Does your php file include another file? Is there any variables being sent to the php file? If you can post code that would help.
    Just realized my mistake...... I used a require_once("connect.php"); and connect.php is in the htdocs so I guess it thought connect.php was inside that folder... Thanks for your help anyways

Similar Threads

  1. Why Doesn't The jQuery CDN Get A SSL Certificate?
    By LittleApps-Nick in forum Programming Discussion
    Replies: 8
    Last Post: 12-09-2012, 02:13 PM
  2. apache doesn't load index files
    By wardpeet in forum Hosting Security and Technology
    Replies: 4
    Last Post: 08-06-2012, 10:53 AM
  3. jquery: script doesn't run on ajax loaded page
    By jjk2 in forum Programming Discussion
    Replies: 4
    Last Post: 07-07-2009, 02:00 PM
  4. Website extremely slow to load/doesn't load (numtcpsock)
    By gnat0 in forum Hosting Security and Technology
    Replies: 1
    Last Post: 12-20-2007, 12:37 PM
  5. how to remove files/folder from temp folder?
    By iNCLiP in forum Hosting Software and Control Panels
    Replies: 4
    Last Post: 02-20-2003, 03:26 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •