javascript - Get data from sites that needs authentication -
i'm trying make google chrome extension gets data other site, question is: can use javascript (or jquery) data sites needs authentication? i.e want data site after log using javascript.
i tried code, doesn't seem work!
$(document).ready(function(){ $("#form").submit(function(event) { event.preventdefault(); var $form = $( ), us= $form.find( 'input[name="user"]' ).val(), pas= $form.find('input[name="pass"]').val(), url = "http://reg.ppu.edu/"; $.ajaxsetup({ username:us, password:pas }); var posting = $.post( url, { email: us, pass: pas} ); posting.done(function( data ) { $( "#result" ).append( data ); }); }); }); this site i'm trying data data from: http://reg.ppu.edu
this error get: uncaught evalerror: refused evaluate string javascript because 'unsafe-eval' not allowed source of script in following content security policy directive: "script-src 'self' chrome-extension-resource:".
Comments
Post a Comment