• DEVHIDE
        • Home (current)
        • About
        • Contact
        • Cookie
        • Home (current)
        • About
        • Contact
        • Cookie
        • Disclaimer
        • Privacy
        • TOS
        Login Or Sign up

        How to display, fetched data from API, in the html page?

        4.4k Views Asked by AudioBubble At 19 August 2010 at 05:26 2025-12-18T10:23:14.897000

        I have an html page. Here, I am using tabview of Yahoo API. That is :

        <div id="demo" class="yui-navset">
            <ul class="yui-nav">
                <li class="selected"><a href="#tab1" onclick="TopStories()"><em>Top Stories</em></a></li>
                <li><a href="#tab2" onclick="FinanceNews()"><em>Finance</em></a></li>
                <li><a href="#tab3" onclick="SportsNews()"><em>Sports</em></a></li>
            </ul>            
            <div class="yui-content">
                <div><p>Top Stories</p></div>
                <div><p>Finance</p></div>
                <div><p>Sports</p></div>
            </div>
        </div>
        

        In the onClickEvent the functions used, fetch data from Google NEWS>

        function TopStories(){
        location.href="http://www.google.com/news/search?aq=f&pz=1&cf=all&ned=in&hl=en&q=TopStories";
        }
        function FinanceNews(){
        location.href="http://www.google.com/news/search?aq=f&pz=1&cf=all&ned=in&hl=en&q=Finance";
        }
        function SportsNews(){
        location.href="http://www.google.com/news/search?aq=f&pz=1&cf=all&ned=in&hl=en&q=Sports";
        }
        

        But the Output is navigation to NEWS page. But, I want to display them as Tab Content.

        What should I do ?

        javascript html api uitabview
        Original Q&A
        1

        There are 1 best solutions below

        2
        Amit Soni Amit Soni On 19 August 2010 at 05:52 BEST ANSWER

        You can use iframe for this purpose .. see below example ,,

        Using Jquery tab, its always create a div where your result display. You have only way to open external link on your page using .

        <li><a href=ReturnIfram()><span>Google</span></a></li>
        

        href get a string which contain ifram like

        public string ReturnIfram()
        {
           return "<iframe src="http://google.fr"></iframe>"
        }
        

        try above in javascript see below example

        <html>
        <head>
        <script language="JavaScript" type="text/javascript">
        function makeFrame() {
           ifrm = document.createElement("IFRAME");
           ifrm.setAttribute("src", "http://developerfusion.com/");
           ifrm.style.width = 640+"px";
           ifrm.style.height = 480+"px";
           document.body.appendChild(ifrm);
        }
        </script>
        </head>
        <body>
        <p><a href="#" onMouseDown="makeFrame()">GO! </a></p>
        </body>
        </html> 
        

        Related Questions in JAVASCRIPT

        • Using Puppeteer to scrape a public API only when the data changes
        • inline SVG text (js)
        • An array of images and a for loop display the buttons. How to assign each button to open its own block by name?
        • Storing the preferred font-size in localStorage
        • Simple movie API request not showing up in the console log
        • Authenticate Flask rest API
        • Deploying sveltekit app with gunjs on vercel throws cannot find module './lib/text-encoding'
        • How to request administrator rights?
        • mp4 embedded videos within github pages website not loading
        • Scrimba tutorial was working, suddenly stopped even trying the default
        • In Datatables, start value resets to 0, when column sorting
        • How do I link two models in mongoose?
        • parameter values only being sent to certain columns in google sheet?
        • Run main several times of wasm in browser
        • Variable inside a Variable, not updating

        Related Questions in HTML

        • How to store a date/time in sqlite (or something similar to a date)
        • How to use custom font during html to pdf conversion?
        • Storing the preferred font-size in localStorage
        • mp4 embedded videos within github pages website not loading
        • Scrimba tutorial was working, suddenly stopped even trying the default
        • Is there any way to glow this bulb image like a real light bulb
        • With non-graphical maps in Leaflet, zoomDelta doesn't work
        • What can I do to improve my coding on both html and css
        • Uncaught TypeError: google.maps.LatLng is not a constructor at init (script.js:7:13)
        • Bootstrap modal not showing at the desired position on a web page when the screen size is smaller
        • Displaying a Movie List on a Website Using Jinja2 and Bootstrap
        • How to redirect to thank you page after submitting a Google form embedded into a Google Site?
        • Storing selected language in localStorage
        • Fences (parenthesis, braces) in HTML and MathML
        • Understanding Scroll Anchoring Behavoir

        Related Questions in API

        • Google Sheets API - Append Request not working
        • Is there really no product for docs that has these?
        • How to show suggested content in response using Azure Cognitive Search?
        • error message when closing current position in binance futures, using ccxt library
        • How to filter API data in React Native
        • I have fetched an API with JS, but the output looks really bad and I don't know how to fix it
        • Session is not storing in react and Asp Dot Core Web API
        • Apex charts not rendering series value, showing cannot map values of NULL
        • Configure IIS to accept API calls only from API Manager, Deny from direct calls
        • Problems with API return using the Axios library in NextJS
        • How to query by Iteration in pyral?
        • Is there a way to have a user enter a url query and have a single function filter a database?
        • Cant get value in Vue from data
        • Read stories/posts using instagram API
        • Need To Make Minor Change To REST API Response

        Related Questions in UITABVIEW

        • Should I use prepareForReuse of UITableViewCell if the cell is built by UIContentConfiguration?
        • Swipe a uiView in Swift like Tab View Controller
        • Do not reload content in the top view in a navigation on tab switch
        • SwiftUI PageTabView in iOS14.2 will Recall ChildView onAppear method Many times
        • TabView SwiftUI return to Home page on click
        • Navigation View formatting Inside of custom UITabBarController
        • SwiftUI iOS 13.3 Missing Navigation Bar title when nested inside TabView
        • How to make a timer in SwiftUI keep firing when changing tab with tabview
        • SwiftUI TabView Rearrange Tab Order Preservation
        • Making TabView not translucent on SwiftUI produces a new view on top
        • How to display the tabs when click the back button from hided tab view controller
        • How to initialise a VC or Class iOS, ObjectiveC
        • Swift - add colored top border for selected tab
        • The cell of tavbview quickly slides into a blank
        • Cannot get values from API when called simultaneously in TabViewController 1 & 2 - Objective C

        Trending Questions

        • UIImageView Frame Doesn't Reflect Constraints
        • Is it possible to use adb commands to click on a view by finding its ID?
        • How to create a new web character symbol recognizable by html/javascript?
        • Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
        • Heap Gives Page Fault
        • Connect ffmpeg to Visual Studio 2008
        • Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
        • How to avoid default initialization of objects in std::vector?
        • second argument of the command line arguments in a format other than char** argv or char* argv[]
        • How to improve efficiency of algorithm which generates next lexicographic permutation?
        • Navigating to the another actvity app getting crash in android
        • How to read the particular message format in android and store in sqlite database?
        • Resetting inventory status after order is cancelled
        • Efficiently compute powers of X in SSE/AVX
        • Insert into an external database using ajax and php : POST 500 (Internal Server Error)

        Popular # Hahtags

        javascript python java c# php android html jquery c++ css ios sql mysql r reactjs node.js arrays c asp.net json

        Popular Questions

        • How do I undo the most recent local commits in Git?
        • How can I remove a specific item from an array in JavaScript?
        • How do I delete a Git branch locally and remotely?
        • Find all files containing a specific text (string) on Linux?
        • How do I revert a Git repository to a previous commit?
        • How do I create an HTML button that acts like a link?
        • How do I check out a remote Git branch?
        • How do I force "git pull" to overwrite local files?
        • How do I list all files of a directory?
        • How to check whether a string contains a substring in JavaScript?
        • How do I redirect to another webpage?
        • How can I iterate over rows in a Pandas DataFrame?
        • How do I convert a String to an int in Java?
        • Does Python have a string 'contains' substring method?
        • How do I check if a string contains a specific word?

        Copyright © 2021 Jogjafile Inc.

        • Disclaimer
        • Privacy
        • TOS
        • Homegardensmart
        • Pricesm.com
        • Aftereffectstemplates
        • Jogjafile