While this is definitely the simplest and quickest approach, it will only work if your file is in a particular location on your website. If this plugin is only for this particular site and the site will always be located in the same path relative to the webroot, you could simply hard code the path to be /blocks/totalpoints/ajaxP.php (assuming your site is in the webroot). There are a few ways I can think of to make this work. As soon as you leave it and go to /course/ for example, it would end up looking for /course/blocks/totalpoints/ajaxP.php which doesn't exist of course. This path only exists when it is accessed from the Moodle root directory. The problem is in your Javascript code, specifically the following line: If you think this is a server error, please contact The requested URL was not found on this server. It works, but now the problem is my ajax page run well only in site home when I try to navigate to other page, my plugin page displays but the ajax operation fail and display this error info: '/blocks/totalpoints/classes/pointHandler.php') // this is a file with a getPoints() methodīut when I run the index page I got blank, no output, The concept is I want to display points, using ajax method, so I created a class with a method 'getPoints()' that fetch the points from the database, then I created the ajaxP.php to handle the ajax operation as shown belowĭirroot. Now I don't get error, but the output is blank!!, I am using Moodle 2.9.3+?Īlert(status + error + xhr.responseText)
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |