2016-06-05 4 views
1

stylus을 사용하여 클라이언트 측의 CSS에 일부 코드를 렌더링했습니다.

처음로드 할 때 stylus.min.js 파일을 포함하면 모든 것이 정상적으로 작동합니다.

그러나 스타일러스가 꽤 크기 때문에 필요할 때까지 파일로드를 지연하고 jquery의 1.8.2 $.getScript()으로 잡아 당깁니다. 그것이 내가 끌 수 getScript를 통해로드 된 스크립트에 대한 몇 가지 제한이 있음을

RangeError: stylus:947:26 
    943|  &[data-aaa="1"] 
    944|   margin-top 2em 
    945|  &[data-bbb="1"] 
    946|   transition 1s 
    947|   margin-top -2em 
---------------------------------^ 

Maximum call stack size exceeded 


    at f.visit (http://f264bc8tf77nkh.cloudfront.net/static/1akh96ita/ace/stylus-min.js?_=1465163994282:4:26233) 
    at i.visit (http://f264bc8tf77nkh.cloudfront.net/static/1akh96ita/ace/stylus-min.js?_=1465163994282:4:17594) 
    at f.visit (http://f264bc8tf77nkh.cloudfront.net/static/1akh96ita/ace/stylus-min.js?_=1465163994282:4:26106) 
    at i.visit (http://f264bc8tf77nkh.cloudfront.net/static/1akh96ita/ace/stylus-min.js?_=1465163994282:4:17594) 
    at f.visit (http://f264bc8tf77nkh.cloudfront.net/static/1akh96ita/ace/stylus-min.js?_=1465163994282:4:26106) 
    at i.visit (http://f264bc8tf77nkh.cloudfront.net/static/1akh96ita/ace/stylus-min.js?_=1465163994282:4:17594) 
    at f.visit (http://f264bc8tf77nkh.cloudfront.net/static/1akh96ita/ace/stylus-min.js?_=1465163994282:4:26106) 
    at i.visit (http://f264bc8tf77nkh.cloudfront.net/static/1akh96ita/ace/stylus-min.js?_=1465163994282:4:17594) 
    at f.visit (http://f264bc8tf77nkh.cloudfront.net/static/1akh96ita/ace/stylus-min.js?_=1465163994282:4:26106) 
    at i.visit (http://f264bc8tf77nkh.cloudfront.net/static/1akh96ita/ace/stylus-min.js?_=1465163994282:4:17594) 

인가 : 이렇게

날이 오류를 준다?

감사합니다.

로드 코드 :

load = function(templateName, callback) { 
    if (_.str.endsWith(templateName, '.js')) { 
    var url = '//' + settings.cdn + '/static/' + settings.assetsTime +'/' + templateName 

    $.getScript(url, function(data, textStatus, jqxhr) { 
     if (callback) callback() 
    }); 
    return 
    } 
} 

나는이 같은 코드로 다른 많은 파일을로드하고 잘 작동합니다.

+0

파일을로드하는 데 사용하는 정확한 코드를 알려주세요. – jfriend00

+0

@ jfriend00로드 코드가 추가되었습니다. 또한 jquery v 1.8.2 어쩌면 그 차이가 무엇입니까? – Harry

+0

getScript를 호출하기 전에 이미로드되었는지 확인합니다. – faster

답변

1

NVM 문제가 축소되었습니다.