Scheduling a Task for every minute in Windows 2012
2,688
Even though the GUI drop down menu only goes down to 5 minutes... just try manually typing in 1 minute.
Related videos on Youtube
Author by
hello
Updated on September 18, 2022Comments
-
hello over 1 year
Hi i have this script when link is click the data will be saved into the database. Now my problem is after clicking the link this is the error:
ReferenceError: ajax_object is not defined
This is my script below in single-knowledge page
<script type="text/javascript"> jQuery(document).ready(function($) { $(".dL").click(function(){ var name = ($(this).attr('name')); var urldata = ($(this).attr('href')); var data = { 'action': 'my_action', 'name': name, 'urldata': urldata // We pass php values differently! }; // We can also pass the url value separately from ajaxurl for front end AJAX implementations jQuery.post(ajax_object.ajax_url, data, function(response) { // alert('Got this from the server: ' + response); alert(response); }); }); }); </script>
This is my function.php script below
function my_action(){ global $wpdb; // this is how you get access to the database $name = $_POST['name']; $url = $_POST['urldata']; $wpdb->insert('list_of_downloads', array( 'name' => $name, 'filename' =>$url )); // wp_die(); // this is required to terminate immediately and return a proper response } add_action( 'wp_ajax_my_action', 'my_action' ); add_action( 'wp_ajax_nopriv_my_action', 'my_action' ); // <= this one
The problem is this one
ajax_object
Can someone help me figured this thing out? Any help is muchly appreciatd. TIA-
hello over 6 yearscan you help me on this one?
-
Milan Chheda over 6 yearsI think, instead of
ajax_object.ajax_url
, you need to useurldata
-
pavel over 6 yearsTry to define this variable first. This is not a chat, variables are in each js book/manual in the second chapter.
-
-
alexus over 11 yearsthanks, you forgot "for a duration of"
Indefinitely
, but I got the idea) thanks! -
alexus over 11 yearswhere can I see logs about this task? it shows me that it ran successfully yet in IIS logs I'm not seeing a hit.
-
Ryan Ries over 11 yearsWell that's complicated. As long as something was excecuted and returned, the Task Scheduler thinks everything's cool. But in reality what was executed might not have been what you intended. If wget has any logging parameters, now would be a good time to use them. As well as adding 2>&1>out.log to the end of your command for debugging purposes to capture all stdout and stderr output from the command that was executed.
-
Ryan Ries over 11 yearsIf that doesn't do it for you, I humbly suggest submitting that problem as a new question, as in my opinion that's a whole different issue than what was asked in this question.