Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 21st, 2012  |  syntax: None  |  size: 0.57 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Making an AJAX call from included JavaScript File?
  2. <script type="text/javascript" src="HumbleFinance.js"></script>
  3.        
  4. jQuery.ajax({
  5.      url: '/HumblFin/Serv',
  6.      type: 'GET',
  7.      contentType: 'application/json',
  8.      dataType: 'json',
  9.      timeout: 5000,
  10.      success: function(data) {
  11.       drawChart(data);
  12.    }
  13.        
  14. function callAjax(data){
  15. jQuery.ajax({
  16.      url: '/HumblFin/Serv',
  17.      type: 'GET',
  18.      contentType: 'application/json',
  19.      data: data,
  20.      dataType: 'json',
  21.      timeout: 5000,
  22.      success: function(data) {
  23.       drawChart(data);
  24.    }
  25. }