简体   繁体   English

无法在Tizen Web应用程序中加载外部javascript文件

[英]Unable to load a external javascript file in a Tizen Web application

I'm trying to do something very basic - including an external JS File, but I can't get it to work. 我正在尝试做一些非常基本的事情-包括一个外部JS文件,但是我无法使其正常工作。

Relevant HTML 相关HTML

<head>
<script src="https://openlayers.org/en/v4.1.1/build/ol.js"></script>
</head>

config.xml config.xml中

<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets" id="http://yourdomain/dezedan" version="1.0.0" viewmodes="maximized">
    <access origin="*" subdomains="true"/>
    <access origin="https://openlayers.org/" subdomains="true"/>
    <tizen:application id="iFnT8pQIzT.dezedan" package="iFnT8pQIzT" required_version="3.0"/>
    <content src="index.html"/>
    <feature name="http://tizen.org/feature/screen.size.all"/>
    <icon src="icon.png"/>
    <name>test</name>
    <tizen:privilege name="http://tizen.org/privilege/internet"/>
    <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
    <tizen:profile name="wearable"/>
</widget>

things I've tried including in config.xml (unsuccessfully) 我尝试过的东西包括在config.xml中(未成功)

<access origin="http://openlayers.org/" subdomains="true"/>
<access origin="https://openlayers.org/en/v4.1.1/build/ol.js" subdomains="true"/>
<access origin="http://openlayers.org/en/v4.1.1/build/ol.js" subdomains="true"/>

As far as I see can I'm doing everything correctly; 据我所知,我可以正确地做所有事情。 but obviously I'm missing something! 但显然我缺少了一些东西! It would be greatly appreciated if anyone could shed some light on what I'm missing. 如果有人能阐明我所缺少的内容,将不胜感激。

Use this 用这个

<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.1.1/ol.js"</script>

Instead of 代替

<script src="https://openlayers.org/en/v4.1.1/build/ol.js"></script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM