Ajax not working in Chrome extension?

Jackled

New Member
I am trying to write a sample extension, this is how it should work. My extension has an option page, when people click on the sign-in button, it sends an ajax request to test.php and gets information to alert user. But it does not work, I don't know why. this is my folder structure\[code\]chrome \ manifest.json \ options.html \ options.js \ test.php\[/code\]in options.html \[code\]<div class="login-button" id="login-button">Sign in</div>\[/code\]in options.js\[code\] $(document).ready(function(){ alert('hello'); $('#login-button').click(function() { loginAjax(); }); }) function loginAjax() { $.ajax({ url: 'test.php', data: "", dataType: 'json', success: function(data) { alert(data); } }); }\[/code\]In the Ajax URL I tried to put an absolute path, but it does not work.Thanks in advance.Edit: It already work, i don't know:-D
 
Back
Top