Posts: 723
Threads: 206
Joined: Sep 2017
Reputation:
0
12-09-2019, 08:09 PM
(This post was last modified: 12-09-2019, 08:11 PM by richb201.)
My php code is running along fine. At some point I make this call:
$this->load->view("javascript_funcs_extensionloaded","snapshot_mode2");
The javascript_funcs_extensionloaded.js is in my /js directory.
I have put some breakpoints in the javascript_funcs_extensionloaded file, but they never get triggered. So either phpStorm is not allowing me to debug a js file, or the js file is not really loading or being called correctly. Any idea on how to resolve this?
proof that an old dog can learn new tricks
Posts: 723
Threads: 206
Joined: Sep 2017
Reputation:
0
12-10-2019, 06:19 AM
(This post was last modified: 12-10-2019, 06:19 AM by richb201.)
Let's see if I understand? I should change the line in my calling php file to:
$this->load->view('javascript_funcs_extensionloaded.php');
And at the top of javascript_funcs_extensionloaded.php I should have
<script src="<?= base_url();?>js/javascript_funcs_extensionloaded.js" />
???
proof that an old dog can learn new tricks
Posts: 4,373
Threads: 101
Joined: Oct 2014
Reputation:
146
You can always see what is going on by using your web browsers development tools F12 console.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Posts: 723
Threads: 206
Joined: Sep 2017
Reputation:
0
12-10-2019, 08:01 PM
(This post was last modified: 12-10-2019, 08:39 PM by richb201.)
Insite, I use the chrome debugger extensively to debug the Extension. The problem is "where do I put the breakpoint"? What I am doing is sending some data from the php program to the Extension. But it never seems to arrive at the Extension. I'd like to see what fails in the .js function call but phpStorm will not allow me to debug a .js file. So I opened up the Chrome debugger on the js/javascript_funcs_extensionloaded.js file and put a breakpoint in the main function init. But it is not getting triggered.
I might have a hint. I took a look in the log and I see:
ERROR - 2019-12-11 03:32:23 --> Severity: 8192 --> idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated /app/system/libraries/Form_validation.php 1234
Does anyone know what this is and why I am getting it?
proof that an old dog can learn new tricks
Posts: 723
Threads: 206
Joined: Sep 2017
Reputation:
0
12-11-2019, 02:48 AM
(This post was last modified: 12-11-2019, 03:14 AM by richb201.)
This is the .js file being referenced. I never see any data being transfered.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script language="javascript">
var nc = $.noConflict()
// Code that uses other library's $ can follow here.
nc(document).ready( function() {
var editorExtensionId = "lamacgnkfoiknjpleghfknfigbmhdaei";
// unload when done
nc(window).on('beforeunload',(function(){
chrome.runtime.sendMessage(editorExtensionId, "snapshot_mode_unload")
}))
// alert (data);
// chrome.runtime.sendMessage(editorExtensionId, data,
chrome.runtime.sendMessage(editorExtensionId, "snapshot_mode1",
function (response) {
if (!response.success)
handleError(url);
}
)
})
</script>
proof that an old dog can learn new tricks