Jump to content

ava_barbilla

Members
  • Content Count

    47
  • Joined

  • Last visited

Community Reputation

0 Neutral

About ava_barbilla

  • Rank
    Newbie
  1. Thank you justsomeguy. I will change the functions interval to 2 seconds and will find out a way to summarise this process. Once I get any positive feedback from this entire process I will let you know. King regards once again!!
  2. I did so, and this helped this move a step forward. Now the value refreshes, but sadly, it refreshes every second although data in the php file has not changed. I will give you some details in terms of my entire process. I use WP Web Scraper which is a plugin for WordPress which scrapes data from a website and displays it on your website using shortcodes or php code. I use this plugin to scrape a data from a website (This is to give you an overall view of what I am doing). My php file contains this: <?phprequire('../../wp-blog-header.php'); //I use this to load the WordPress environment
  3. I followed your advice use "console.log" and when I go to the inspector ("Console Tab"), nothing appears and when the page is refreshed still the console is empty.
  4. I get no error from the server. I simply get nothing. This I think means that the "if" operator has the error or no data is transferred, however, in my first code it worked so I suppose this has to do with the "if". I tried changing this to another code which looks like this: $(document).ready(function () { $('#demo').load('http://localhost:8888/test-site/wp-content/my-php-files/test.php'); var auto_refresh = setInterval( function () { function testing() { var result = null; var div = $('#demo').html(); var scriptUrl = "http://localhost:8888
  5. Ok I understand. I utilised: $.ajax({ url: scriptUrl, type: 'POST', // I tried "GET" as well dataType: 'html', async: false, // Note here I used a synchronous request However, just as you stated that the browser pauses, my browser started to run very slow so I decided to delete it. I rearranged my structure as follows: $(document).ready(function () { var auto_refresh = setInterval( function () { function testing() { var result = null; var scriptUrl = "http://localhost:8888/test-site/wp-content
  6. In my previous question I managed to solve a way to load an external php file into my html thanks to your help. The php file loads perfectly fine as long as it follows the simple to criteria to load php after a given amount of time, which in my case is 1000 milliseconds. I wanted to know a method which loads data from the php file ONLY, and ONLY if the data in that php file has changed. My script what I managed to do after hours of research looks like follows: <script type="text/javascript">$(document).ready(function () { var auto_refresh = setInterval( function () {
  7. I added some html to the php file and everything loads except the php file (php appeared as a comment). Then, I came up with the idea to compare the php file I created with the other php files on my local server. I identified a little difference. The other php files do not close the php, i.e. <?php echo 'Hello World'; without putting "?>" at the end, and now it works. My php file looks like this: <?phpecho 'Hello World'; I also simplified my script, making my structure look like follows: <div id="demo"><div> <script src="https://ajax.googleapis.com/ajax
  8. Yes, I tried that already. I tried renaming the file and other tricks as well. How can I upload pictures here? Maybe I can send some screenshots so that you can see how my localhost looks like and some other screenshots which may be of use furthermore. Moreover, when I click on "Inspect Element", go to the network tab and click on refresh I can see all the movement that happens. One of them is the the Ajax Request with the type "POST" and Status 200 (OK). I have been doing some research but sadly I found nothing useful regarding this subject. Does it have to do with the fact that I use Caching
  9. Ok, I have tried that as well. Still the same. The browser does not process the php and just displays <?php echo 'Hello, World!'; ?> instead of showing "Hello World".
  10. I use localhost if not any page would not be loaded. I was not sure which url you needed so I provided both. My Ports are as follows: Apache Port: 8888 Nginx Port: 7888 MySQL Port: 8889 My PHP version is 5.6.2 and my Webserver is Apache. Hope this helps, as perhaps this problem ay have to do with the ports. What would you suggest?
  11. Yes, indeed. The complete URL of the file is in the javascript code.
  12. No I have managed to get the link published. Really sorry about that.
  13. "view-source:file://localhost/Applications/MAMP/htdocs/test-site/wp-content/my-php-files/test.php"
  14. THis is the link when I open the file directly from my documents:
  15. Sorry for the blank posts. There is an issue the link does not get published!
×
×
  • Create New...