Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8038211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:09:37+00:00 2026-06-05T03:09:37+00:00

I have a javascript widget which fetches articles from Wikipedia through MediaWiki API (http://en.wikipedia.org/w/index.php?title=Main_Page&action=render).

  • 0

I have a javascript widget which fetches articles from Wikipedia through MediaWiki API (http://en.wikipedia.org/w/index.php?title=Main_Page&action=render). It’s an app for Samsung Smart TVs. Now the text part works fine, but it won’t display any images because the img src is structured like this:

“//en.wikipedia.org/wiki/File:example.jpg”

and I’ve come to realize by using a PC emulator that the Samsung firmware converts it to this type of full url:

“file://localhost/en.wikipedia.org/wiki/File:example.jpg”

Is it possible to add “http:” to the src so that the app points to the correct links hence displaying both thumbnails and full-size images?

Here’s the relevant part of the js code:

UIContents.showImage = function(srcURLFromWikiPage, showHigherResolution) {
//    alert("UIContents.fillDescription()");


    var cutURL = srcURLFromWikiPage;

    //document.getElementById('UIContentsImgFrameiFrame').href = srcURL;
    //window.frames.UIContentsImgFrameiFrame.location.href = srcURL + "#file";

    //prepare link for full-size picture:
    //cutURL = cutURL.replace('thumb/','');
    //cutURL = cutURL.substring(0, cutURL.lastIndexOf('/'));

    //show preview thumb version
    //if (cutURL.match(/\.svg$/)) cutURL = srcURLFromWikiPage;
    alert('img src: ' + cutURL);
    //show preview thumb version
    var elemImg = document.getElementById('UIContentsImgFrameImage');

    document.getElementById('UIContentsImgFrame').style.display = 'block';
    //set image source
    if (showHigherResolution == true) elemImg.onload = 'UIContents.resizeImage()';
    elemImg.alt = 'loading...';
    elemImg.src = cutURL;

    elemImg.style.visibility = 'hidden';
    elemImg.style.visibility = 'visible';

    imageViewIsOpened = true;

    document.getElementById('UISearchField').style.visibility = 'hidden';
    document.getElementById('UISearchTextInput').style.visibility = 'hidden';

Any suggestions? Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T03:09:39+00:00Added an answer on June 5, 2026 at 3:09 am
    var cutURL = srcURLFromWikiPage.replace("file://localhost/","http://");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://jsfiddle.net/4B2Bc/1/ <- the link to the widget I have this javascript widget, which I
I have a JavaScript widget which communicates with my Rails app by creating tags
I have a javascript widget which indicates the server status with alarm LED picture.
I am creating a JavaScript widget which gets around 4-6KB of data from a
I have a JavaScript widget which provides standard extension points. One of them is
Given an html/javascript 'widget' which needs to have certain fields customized before use. For
Lets say you have a JavaScript widget which needs to fire off a request
We have a widget which is inserted via Javascript. <div class=tp_-_box data-tp-settings=domainId:7913 hidden> <a
I want to develop a little os x widget which fetches data from an
I have some javascript which will create some sort of widget on a page.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.