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 don't display image #15861

Closed
navata opened this issue Sep 8, 2017 · 2 comments
Closed

Webview don't display image #15861

navata opened this issue Sep 8, 2017 · 2 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@navata
Copy link

navata commented Sep 8, 2017

This is my code and it can't display image.

<WebView
   source={{html: `<img src='//i.pinimg.com/564x/41/76/2e/41762e489565279690334d5d38815b0f.jpg'>` }}
   style={{flex: 1}}
   javaScriptEnabled={true}
>
</WebView>

But I change src='https://i.pinimg.com/564x/41/76/2e/41762e489565279690334d5d38815b0f.jpg' and it work.
Why? Please help me

@RD1991
Copy link

RD1991 commented Sep 8, 2017

May be a simple example for this if you try searching the string
'//i.pinimg.com/564x/41/76/2e/41762e489565279690334d5d38815b0f.jpg' on URL bar (Chrome) then it will search in local system, but when you search using
'https://i.pinimg.com/564x/41/76/2e/41762e489565279690334d5d38815b0f.jpg' or
'http://i.pinimg.com/564x/41/76/2e/41762e489565279690334d5d38815b0f.jpg' it searches on the web.

So instead of passing the string without HTTP just prepend it with http.

I think it is happening because RN tries to search in your code/directory when http is not passed.

@hramos
Copy link
Contributor

hramos commented Sep 8, 2017

This issue looks like a question that would be best asked on StackOverflow.

StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only.

Will close this as this is really a question that should be asked on StackOverflow.

@hramos hramos closed this as completed Sep 8, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Sep 8, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Sep 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants