Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebView on android 5.1 can`t execute javascript #17329

Closed
guohz-git opened this issue Dec 23, 2017 · 2 comments
Closed

WebView on android 5.1 can`t execute javascript #17329

guohz-git opened this issue Dec 23, 2017 · 2 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@guohz-git
Copy link

Use WebView to load H5 pages, work well in high versions of Android and IOS, and do not perform JS on the android5.1 system. Please help me!

Have you read the Contributing Guidelines?

I've read the official web documents and try a lot of attributes that don't work

Environment

Environment:
OS: Window2010
Node: v6.11.2
npm: 5.5.1
Xcode: Xcode9.2
Android Studio: 2.3 AI-162.4069837

Packages:
react-native: 0.50.2
react: 16.0.0
H5 JS Framework: Vue JS
Target Platform: Android 5.1, Android 7..1.1(OK)

Steps to Reproduce

(Write your steps here:)

## 1. Test Android 7.1
image

2. Test Android 5.1
image

3. IOS Test is OK

Expected Behavior

image

     <WebView
                    ref='webView'
                    automaticallyAdjustContentInsets={false}
                    style={styles.webView}
                    source={{ uri: "http://106.14.148.112:8080/ez/index.html?carId=1" }}
                    onLoadEnd={(e) => this.onLoadEnd(e)}
                    startInLoadingState={false}
                    scalesPageToFit
                    javaScriptEnabled={true}
                    domStorageEnabled={true}
                    onError={(e) => this.onLoadError(e)}
                    onMessage={(e) => this.onMessage(e)}
                />
   <body>
		<div class="mui-content">
			<div id="slider" class="mui-slider mui-fullscreen" data-slider="8">
				<ul id="onlineShop"  class="mui-table-view mui-grid-view mui-grid-12">
		            <li v-for="item in items"  class="mui-table-view-cell mui-media mui-col-xs-3 mui-col-sm-3"><a href="#">
		                    <span class="mui-icon"><img class="iconImg" :src="'http://www.enzhengcar.com:8080/images'+ item.productclassicon"></span>
		                    <div class="mui-media-body">{{item.productclassname}}</div></a></li>
		        </ul>
		        <div class="boutique">
		        	<div class="title"><img src="image/shopU9.png">精品推荐</div>
		        	<div  id="pullrefresh" class="mui-content mui-scroll-wrapper">
						  <div class="mui-scroll">
						    <!--数据列表-->
						    <ul id="Shoplist"  class="goodsBox mui-table-view-chevron">
						    	<li v-for="item in items"  class="goode-msg mui-media">
									<a href="javascript:;">
										<img class="c_picture mui-pull-left" :src="'http://www.enzhengcar.com:8080/images'+ item.smallimg">
										<div class="mui-media-body">
											<p class="mui-ellipsis">{{item.productname}}</p>
											<p class="fontW">图号:{{item.model}}<span>产地:{{item.origin}}</span></p>
											<p class="fontW">品牌:{{item.brand}}</p>
											<p class="goodsPrice">¥{{item.productprice}}.00</p>
										</div>
									</a>
								</li>
						    </ul>
						  </div>
					</div>
		        </div>
			</div>     
		</div>
		
	</body>
  /*商品分类列表*/
var vue=new Vue({
	el:"#onlineShop",
	data:{
		items:[],
	},
	mounted:function (){
		let obj = this;
		let url ="http://www.enzhengcar.com:8080/njezapp/ezcarapp/getAllFirstProductClass";
		fetch(url,
                {
                method: 'post',
                }).then(function(response) {
                    console.log(response);
                    return response.json();
                }).then(function(data) {
                	obj.items = data.object.productClasses;  
                             
                }).catch(function(err) {
                    console.log("error");
            });
	}
});
/*推荐商品列表*/
var vue=new Vue({
	el:"#Shoplist",
	data:{
		items:[],
	},
	mounted:function (){
		let obj = this;
		let url ="http://www.enzhengcar.com:8080/njezapp/ezcarapp/getProductInFront";
		let formData = new FormData();  
		formData.append("pageIndex","1");  
		formData.append("pageSize","10");
		formData.append("id","2");  
		fetch(url,
                {
                method: 'post',
                body:formData,
                }).then(function(response) {
                    console.log(response);
                    return response.json();
                }).then(function(data) {
                	obj.items = data.object.products;           
                }).catch(function(err) {
                    console.log("error");
            });
	}
});
@react-native-bot
Copy link
Collaborator

@facebook-github-bot no-template

@facebook-github-bot
Copy link
Contributor

Hey @yuzhongyouqing, thanks for posting this! It looks like your issue is missing some required information. Can you please add all the details specified in the Issue Template? This is necessary for people to be able to understand and reproduce your issue. I am going to close this, but please feel free to open a new issue with the additional information provided. Thanks!

How to ContributeWhat to Expect from Maintainers

@facebook-github-bot facebook-github-bot added the Ran Commands One of our bots successfully processed a command. label Dec 23, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Dec 23, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Dec 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants