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

Untitled

By: a guest on Apr 15th, 2012  |  syntax: None  |  size: 1.07 KB  |  hits: 5  |  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. How do I load html into a variable with jquery
  2. $("#my_div").load("http://www.mypage.com");
  3.        
  4. my_var = load("http://www.mypage.com");
  5.        
  6. HLS.functions.LoadSideModules = function() {
  7.     HLS.sideModuleContent = new Object();
  8.     for(var i = 0; i < HLS.currentModuleConfig.POLICIES.POLICY.length; i++) {
  9.         for(var y = 0; y < HLS.currentModuleConfig.POLICIES.POLICY[i].PAGES.PAGE.length; y++) {
  10.             for(var POS in HLS.currentModuleConfig.POLICIES.POLICY[i].PAGES.PAGE[y]) {
  11.                 var item = HLS.currentModuleConfig.POLICIES.POLICY[i].PAGES.PAGE[y][POS];
  12.                 if(!HLS.sideModuleContent[item]) {
  13.                     HLS.sideModuleContent[item] = j.get(HLS.config.K2GETMODULE + HLS.currentModuleConfig.POLICIES.POLICY[i].PAGES.PAGE[y][POS]);
  14.                 }
  15.             }
  16.         }
  17.     }
  18. };
  19.        
  20. $.get("http://www.mypage.com", function( my_var ) {
  21.     // my_var contains whatever that request returned
  22. });
  23.        
  24. $.get("http://www.mypage.com", function( my_var ) {
  25.     // my_var contains whatever that request returned
  26. }, 'html');  // or 'text', 'xml', 'more'