Note that there are some explanatory texts on larger screens.

plurals
  1. POApache load php and local file error: "Unsafe JavaScript attempt to access frame with URL..."
    text
    copied!<p>I have Apache set up through xampp to test a webpage to load some .php file to read a .csv file as data source to output a bar graph chart. And I encounter this error on Chrome. </p> <p>Unsafe JavaScript attempt to access frame with URL file:///C:/xampp/htdocs/search/php/loader/csvFileUploader.php from frame with URL file:///C:/xampp/htdocs/search/stackedBarChart.html. Domains, protocols and ports must match. upclick-min.js:99 i.onload_callback.i.onload_callback upclick-min.js:99 onload</p> <p>I don't think this is an iframe problem like many other posts have suggested. I tested this also through firefox, it went beyond reading the php but doesn't load the .csv file from local directory.</p> <p>Any suggestions?</p> <pre><code>&lt;script&gt; var uploaderCSV = document.getElementById('uploaderCSV'); upclick({ element : uploaderCSV, action : 'php/loader/csvFileUploader.php', onstart : function(filename) { console.log(" -- Start upload: &lt;" + filename + "&gt; Here"); }, oncomplete : function(response_data) { alert(response_data); console.log(" -- CSV file to load: ", response_data); var n = response_data.split("|"); if (n.length &gt; 1) { console.log(" &gt;&gt; csv file loaded at[ ", n[1], " ]"); loadDayLightFactor("php/loadCSV.php", "../" + n[1]); } } }); &lt;/script&gt; </code></pre> <p>and here's the php file</p> <pre><code>&lt;?php // using upload at click from http://code.google.com/p/upload-at-click/ // FileData is the name for the input file $file_result = ""; $file = $_FILES['Filedata']; $allowedExtensions = array("csv", "txt"); $extension = end(explode(".", $file["name"])); echo "123".$file; </code></pre> <p>?></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload