aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/com.js
diff options
context:
space:
mode:
authorpzread <netfirewall@gmail.com>2013-07-12 02:10:18 +0800
committerpzread <netfirewall@gmail.com>2013-07-12 02:10:18 +0800
commit456b6867161c1f1295993c61b3726ff44a3c809e (patch)
treefc904f499a613cc9250e22716764c8ba3059f518 /src/js/com.js
parent0d25481f72f12eaf0ccfc3172829f0d138a1143c (diff)
downloadtaiwan-online-judge-456b6867161c1f1295993c61b3726ff44a3c809e.tar
taiwan-online-judge-456b6867161c1f1295993c61b3726ff44a3c809e.tar.gz
taiwan-online-judge-456b6867161c1f1295993c61b3726ff44a3c809e.tar.bz2
taiwan-online-judge-456b6867161c1f1295993c61b3726ff44a3c809e.tar.lz
taiwan-online-judge-456b6867161c1f1295993c61b3726ff44a3c809e.tar.xz
taiwan-online-judge-456b6867161c1f1295993c61b3726ff44a3c809e.tar.zst
taiwan-online-judge-456b6867161c1f1295993c61b3726ff44a3c809e.zip
sqmod_test update. Better way to load css
Diffstat (limited to 'src/js/com.js')
-rw-r--r--src/js/com.js27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/js/com.js b/src/js/com.js
index 3b162c2..1c8af3c 100644
--- a/src/js/com.js
+++ b/src/js/com.js
@@ -472,17 +472,32 @@ var com = new function(){
urlchg_reen = false;
};
- that.loadpage = function(htmlurl){
+ that.loadpage = function(html_url,css_url){
var j_index_page = $('#index_page');
+ var j_css;
var defer = $.Deferred();
- j_index_page.empty();
- j_index_page.load(htmlurl,function(data,stat,xhr){
- that.exheight();
+ function loadhtml(){
+ $.get(html_url,function(data){
+ j_index_page.append($(data));
+ that.exheight();
+ defer.resolve();
+ });
+ }
- defer.resolve();
- });
+ j_index_page.empty();
+ if(css_url != undefined){
+ j_css = $('<link rel="stylesheet">');
+ j_css.attr('href',css_url);
+ j_css.ready(function(){
+ loadhtml();
+ });
+ j_index_page.append(j_css);
+ }else{
+ loadhtml();
+ }
+
return defer.promise();
};
that.exheight = function(){