• 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-02T03:57:15.445000

        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

        • Angular Show All When No Filter Is Supplied
        • Why does a function show up as not defined
        • I count the time the user takes to solve my quiz using Javascript but I want the same time displayed on another page
        • Set "More" "Less" font size
        • Using pagination on a table in AngularJS
        • How to sort these using Javascript or Jquery Most effectively
        • how to fill out the table with next values in array with one button
        • State with different subviews
        • Ajax jQuery firing multiple time display event for the same result
        • Getting and passing MVC Model data to AngularJS controller
        • Disable variable in eval
        • javascript nested loops waiting for user input
        • .hover() seems to overwrite .click()
        • How to sort a multi-dimensional array by the second array in descending order?
        • How do I find the fonts that are not loading in a CORS situation ( MoovWeb )?

        Related Questions in HTML

        • Delay in loading Html Page(WebView) from assets folder in real android device
        • Why does a function show up as not defined
        • CSS Class is not applying to element (border width,color,and style attributes)
        • How to sort these using Javascript or Jquery Most effectively
        • how to fill out the table with next values in array with one button
        • Automatically closing tags in form input?
        • Positioning child at bottom of parent with scroll
        • Remove added set of rows
        • Website zoomed out on Android default browser
        • Twitter Bootstrap horizontal form elements on a line
        • http://sigmajs.org/ les mis tutorial - why are my canvases 0 height?
        • My navbar is not expanding after collapse
        • when a checkbox is checked how to display a different hidden element using javascript
        • Gaps Vertically Using Dividers
        • Svg containers not positioning properly

        Related Questions in API

        • SuiteCRM how to retrieve all account related contacts
        • how do i submit a pastebin or pastee from an android app and get the url back
        • BigCommerce PHP API delete Category which contains products
        • Interact with chrome bookmarks outside of extensions
        • purchase individual items and subscriptions in the same PayPal REST API transaction
        • youtube api v3 insert comments
        • Youtube api v3 duration
        • Responding to an Office 365 event invite via REST
        • Convert youtube video to mp3 using Quick MP3 API
        • How to real-time monitor the emails?
        • Laravel - Fractal - Using Find() in transformer file- is it correct or can it be done more efficiently?
        • return data from a Azure API json
        • Accessing Picasa Web API using PHP
        • RAML multivalued form parameter
        • TestFlight API and stats with as3

        Related Questions in UITABVIEW

        • How do I make a view that stays onscreen when the main view segues?
        • From initial View Controller how to segue acriss to a UITabBarController and use prepareForSegue
        • Memory warning doesn't work properly
        • NavBar not showing up in second and third viewcontroller
        • Pass a paramether to a view transition
        • As soon as I make a connection between my code and interface, my tab crashes (iOS SDK 4.2)
        • iphone tab app architecture question
        • iOS tabbed application with table view, how to reset table view tab? Beginner.
        • xcode: creating a viewController for a tab item in StoryBoard results in a black screen
        • Allow change of orientation to landscape for only one tab in UITabViewController
        • UINavigationController with UITabViewController
        • ScrollView with Images - changing tabs on touchesended does not work
        • UITabViewController hide / make appear a view in code
        • How to display the tabs when click the back button from hided tab view controller
        • perform a method every time a tab is selected

        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

        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
        • Math
        • Aftereffectstemplates