FF不支持角度方向更改事件

时间:2016-10-17 13:42:49

标签: javascript angularjs firefox javascript-events orientation-changes

我在FireFox中的orientationchange有问题...在CHrome我没有事件,evet被触发但是在FireFox中它没有被调用。这是代码:

angular.element($window).on('orientationchange', function () { ... });

我遇到同样的问题:

angular.element($window).bind('orientationchange', function () { ... });

和原生JavaScript代码:

window.addEventListener('orientationchange', function () { ... });

我不能使用jQuery ......任何解决方案?感谢

1 个答案:

答案 0 :(得分:0)

最后我使用了这个解决方案并得到了很好的支持:

s=ticker.replace("^","%5E")
if start_date.month-1<10:
    a="0"+str(start_date.month-1)
else:
    a=str(start_date.month-1)

b=str(start_date.day)

c=str(start_date.year)

if end_date.month-1<10:
    d="0"+str(end_date.month-1)
else:
    d=str(end_date.month-1)


e=str(end_date.day)

f=str(end_date.year)

g=freq

yfURL = "http://real-chart.finance.yahoo.com/table.csv?s="+s+"&a="+a+"&b="+b+"&c="+c+"&d="+d+"&e="+e+"&f="+f+"&g="+g+"&ignore=.csv"
return yfURL


webRequest = urllib2.Request(urlOfFile)

try:
    page=urllib2.urlopen(webRequest)

    content=page.read()

    with open(filePath,"wb") as output:
        output.write(bytearray(content))



except urllib2.HTTPError, e:
    print e.fp.read()

ticker = ["FB","C"]

for x in ticker:
    start_date= "2015-01-01"
    end_date= "2017-02-23"
    freq = "d"
    yfURL = constructYFURL(ticker,start_date,end_date,freq)
    fileName="YF_"+str(ticker)+".csv"
    print yfURL
    localFilePath="/Users/student/Downloads/datalibrary/"
    download(localFilePath+fileName,yfURL)