Load Content into a javascript Variable

Hello guys. I very new to spry and I need some help.
How can I load content (text) from a html page(actually I
want to get a result from a dynamic php script) into a javascript
variable?
I saw the fragments example in wich spry loads some html
fragment into a div, etc... but I need the result text to be stored
in a variable so I can test the result before update the div.
Thanks in advance...

I think this function updateContent shoud have a parameter to
tell if we want the content to be loaded inside a container or a
variable. It would be very helpful to integrate php/mysql
validation scripts to forms. I wanted to test if a username was
already in the database when the user choose the username in the
form, so I made a custom function and aplied it to the textbox
validation widget. Its working great, but it would be better if I
didnt have to create invisible divs to receive the response from
the php script I made.
Thanks anyway. Spry is a great product.

Similar Messages

  • Without using applets geting the output into a javascript variable

    Hi,
    I'm not using executeCommand applets in my webpage,but with the url
    i'm running the transaction. I'm passing the url to iframe as a <b>src</b> in the same page itself. like
    <b>document.getElementById("<iframe>").src="http://localhost/Lighthammer/Runner?Transaction=<Transaction_Name>&<Input_params>=<value>&OutputParameter=*"</b>. It will take 10 seconds to execute the transaction and load into the iframe.
    So I'm giving the
    <b>SetTimeout("alert(document.getElementById('<iframe>').docuemnt.body.innerHTML",10000);</b>
    In the iframe i'm able to see the output as "<u>oktransaction executed</u>" in <u>xml format</u>.
    But in the alert I'm not able to see the same content. <i>In the alert I'm able to see</i>
    <u><iframe id="<id of iframe>" src="<Which i set in the script>"></iframe></u>
    Help me to get the OutputParameter value into a javascript variable.

    Rakesh,
    A couple of observations:
    1.  Why are you calling Runner directly?  You should be using an XacuteQuery template, and reference "/Lighthammer/Illuminator?QueryTemplate=Folder/TRX" syntax when changing the URL in the iFrame.
    2.  You are also using "localhost" which is not portable and may also be causing your problem since your parent page will be based upon the server path, whereas you are forcing the browser to load localhost content into the iFrame (which unless you are physically sitting on the xMII server itself will never work).
    Regards,
    Jeremy Good

  • Dynamically load content into a "template" swf from text file

    I have a dream....
    Well, I have a concept. I have not actively pursued Flash in
    several years, though I've continued to have it in my arsenal. I've
    not done much in the action scripting realm for a while though.
    I am trying to create a template that will be used for about
    100 different product pages.
    It would have two tabs, basically, 2 different graphical
    button sets. One will have up to 4 links to similar products, each
    tab will be on the side of a square, and I need the ability to not
    display a tab if there is no actual link.
    As for the other tab, Its a menu that consists of a series of
    lines. This can be an external menu, I just need a way to have
    flash load the right menu. This menu, when you mouse over a line,
    the name of the product appears, as well as a product image that
    gets loaded with the menu. The product images would be external,
    allowing me to simply replace an image if a new higher end version
    of the product comes out.
    So, I am totally not an actionscripter. Looks like I need to
    load variables from an external file. Can I set a property in the
    flash code on the html that tells the movie what dataset to grab
    from?
    Here's basically what I am looking for
    property: value
    (load variables for:)
    item: 44
    (menu1)
    faster: 54b.html
    slower: 34d.html
    left: 43d.html
    right: 45c.html
    (menu2)
    menu:graph5.swf
    (menu loads images from external source)
    link51: 51d.html
    link52: 52c.html
    link53: 53c.html
    link54: 54d.html
    link55: 55b.html
    link56: 56d.html
    A possible third menu would be text driven, and would use
    html to link to various items.
    This is a static site, so urls will be fixed.
    Is it best to build a php page that serves up data for a
    single item, or do one big text file with all 100 or so items? Is
    that even possible?
    My Flash since MX is very rusty. I am using Flash Pro8. I
    would love to create a single file so modifications are to the text
    files, unless a new item is released, then it's updating a single
    flash menu and updating the text file.
    Been spending way too much time in InDesign lately! I used to
    be pretty good at Flash!

    well sorry there fanmap - but I don't think you're going to
    be able to get this to work. here's why: the link points to a php
    file - which gathers dynamic info from a DB - the return from the
    php is generating a string that is based on the DOM and
    'constructs' a javascript method that in turn writes to the html
    document. although we can embed html into a textField in Flash
    there are a limited number of supported html tags - and JS methods
    will not operate internally. in addition, (i'm not certain someone
    correct this if i'm off) there's no way to 'change' the output of
    the php call, therefore you will not be able to read the return
    because it is designed to use the DOM and write solely to the
    current document. Even if you were to access the JS method from the
    swf file (which one can) it will still only write the content of
    the php return to the html document - and the output is not
    compatible with the textField class.

  • .swf being able to load contents into it issue.  Please help?

    Hi there,
    I have strange situation regarding flash that I can't figure out.  I have a flash .swf file that is intended to load .flv video files into them at the local root level.
    I have been able to do this on my own server, but the .swf and the .flv videos are now located on the media streaming server, and the .swf is able to show up on it's own when embedded onto my page (on MY server), but it's not being able to load the video files.  I am perplexed because the videos are structured in the same EXACT way that it was being done on my server, but they will not load onto my .swf as they were doing when they were on my server.
    For example, one of the videos is loaded by using this convention in my actionscript:
    var file = "videos/Bob_Peebler.flv";
    So, on my media hosting service, I've loaded the .swf file on the local root, and the videos are placed in the same exact directory structure as they were done on my server.  In the example above, the  "bob_peebler.flv" is located inside the videos folder, and the videos folder is on the same level as the .swf
    In my flash file, I've thought that the var needs to point to the actual URL of the flash file, so I've then typed out the URL of the flash video, but I still can't seem to get it to work.
    var file = "http://iongeo.fileburst.com/videos/Bob_Peebler.flv";
    Here is where the .swf can be located to get a better sense of what I am trying to accomplish.
    http://iongeo.fileburst.com/ChannelGuide_Features.swf
    Please let me know if I can clarify on something better.
    I would really appreciate any kind of assistance that could be provided.
    Thank you

    Hello
    On my flash, I already have those parameters in place.
    I don't think there would be any security issues however, since I have used a player .swf which loads from the media site and plays the videos without a problem.
    http://www.iongeo.com/channelguide_test_dev/
    click on the four images at the bottom of the screen to see how it works.
    Now, I am pretty much doing the same thing, but this time embedding the other swf to load the videos.  As I mentioned, I was able to do this when everything was on our server, but now there is an issue for some reason when I try to load the .flv into the .swf from the other media server.

  • Loading content into project/timeline from http listener

    Hi
    I have an application which helps producers/researchers browse and search for video assets. Once they have located one or more assets, I would like to be able to "push" them over to Premiere Pro.
    The browser is written in Silverlight, so the only mechanism it has to communicate with Premiere Pro would be via http. I think what I need is a plug in which has an HttpListener listening on a specific port, so that the silverilght application can post information (in edl/xml format) to the port the plugin is listening on. The plugin will then load the assets (mms video streams or files from uris) into the project and/or timeline.
    I would like to write this either using Flex or the Premiere Pro SDK. I need it to run on both Windows and the Mac.
    If anyone can provide any pointers, I would be very grateful.
    Thanks
    Nigel

    Hi Zac
    Thanks for the information.
    Can you clarify this a little for me? If I understand what you have written, I have to create an XML file using FCP format which I save to local storage, then use something like SendMessage in another application to programatically initiate a drop sequence of the file onto the Premiere Pro window. I would have to write two applications, one for the Mac, and one for the PC, using Visual Studio and Objective C rather than use the SDK.
    Is that correct?
    Can you also tell me if a plugin written in Flash/Flex can communicate in any way with the application, such as to automate a file/open sequence. I ask this because I believe Flash can listen on an http port, and avoid the need for separate apps on the Mac and PC.
    What you suggest appears possible, but tying it together in a way invisible to the user might be a bit tricky.
    Thanks
    Nigel

  • Pushing Loader.content into DisplayObject Freezes Animation

    I am working on a slideshow app which involves a bunch of images with mask effects cycling one after the other. I created a buffer to preload images in the background while the animation plays. I am using Tweener for all my tweens, and this has nothing to do with garbage collection or declaring vars inside function scope. The problem is the following lines of code in my complete handler of the flash.display.Loader class cause the animation to freese for a split second:
    _preloadingSlide.source = _preLoader.content;
    _preloadingSlide.loading = false;
    _preloadingSlide.loaded = true;
    _preloadingSlide is an insctance of a custom class that extends Sprite. The source attribute is a setter/getter whos code is as follows:
    public function set source( value:DisplayObject ):void{
                _source = value; //_source is of type DisplayObject
                if( _source!= null ){
                    addChild( _source );
    I have isolated the error to these lines of code. When I halt execution while buffering and wait until all images are loaded there is no issue. Whenever these line execute it freezes the animation for a half second or so. I thought maybe it had to do with the internal copying the bytearray that FLASH is doing. Anyone have any ideas?

    Is the profiler available as a set of AS classes? I use the SDK and I thought it was only for FLEX Builder. I use the underlying classes in flash.sampler to monitor memory consumption, etc as well. I am working on some tests using getTimer to see exactly how long it is takes for the Loader class to assign its content to my class, and as an alternative, exactly how long it takes to convert the bytearray of the bitmap data loaded with URLStream using Loader.loadBytes. I am sure the problem is that these bytearrays are very large due to the image size (900x800 avrg), and whatever internal code goes on in the loader class to convert them to a DisplayObject hangs up the player. Just out of curiosity is the source code of the Loader class available? Once again thanks for the help.

  • Is it possible to load content into a loaded swf?

    I'd like to access a loaded SWF and load images/videos into it and trigger functions inside the loaded *.swf.
    Is this possible ??

    Yes, see the "Chromeless..." examples in the Example Player sample app.  The basic idea is that you subclass SWFElement and map the SWF's API into the MediaElement API, so that your SWFElement subclass can be handed to a MediaPlayer, integrate with compositions, etc.

  • Load contents into one "netui:select" on click of another.

    Hi! I am a fresher to Weblogic Workshop and Portal. I want to know how to capture the onSelect or onChange event in a <netui:select> tag and call a pageflow action on the occurence of this event.

    I remember this keyboard menu. Didn't I give you the CSS for this?  I'm pretty sure I did.  Because I still have it in my notes.
    <!doctype html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>CSS Horizontal Menu</title>
    <!--[if lt IE 9]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
    <style>
    /* BEGIN Horizontal Navbar */
    nav {
    margin: 0 auto;
    padding: 0;
    width: 900px;  /**adjust width as required**/
    font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
    overflow: hidden; /**float containment**/
    border: 1px dotted red; /**for demo purposes, you may delete this border**/
    nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: auto;
    /**list styles**/
    nav li {
    display: block;
    float: left;
    width: auto;
    line-height: 1em;
    margin: 0;
    padding: 0;
    text-align: center;
    font-size: 15px;
    text-shadow: 1px 1px 1px #000;
    /**link styles**/
    nav li a {
    display: block;
    padding: 0.5em;
    border: 2px outset #999;
    color: #FFF;
    font-weight: bold;
    text-decoration: none;
    background: #CCC;
    /**mouseover styles**/
    nav li a:hover,
    nav li a:active,
    nav li a:focus {
    border: 2px inset;
    background: #00CCCC; }
    /* END Horizontal Navbar */
    </style>
    </head>
    <body>
    <nav>
    nav container
    <ul>
    <li><a href="#">Menu Item 1</a></li>
    <li><a href="#">Menu Item 2</a></li>
    <li><a href="#">Menu Item 3</a></li>
    <li><a href="#">Menu Item 4</a></li>
    </ul>
    <!--end nav--></nav>
    </body>
    </html>
    Nancy O.

  • Size of a JavaScript variable

    What can be the maximum size of the javascript variable? I want to store a String into a Javascript variable.

    Just playing around cuz I was curious... in IE this works, with JS and VB functions calling each other. Variables don't seem to be visible across languages though.
    <HTML>
    <HEAD>
    <TITLE>VBScript Test Page</TITLE>
    <SCRIPT LANGUAGE="VBScript">
    <!--
    Sub TestButton_OnClick()
      MsgBox "VBScript function called, going to call JavaScript function now..."
      callJS()
    End Sub
    Sub callVB()
      MsgBox "JavaScript function called this VBScript function!"
    End Sub
    -->
    </SCRIPT>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function doJS() {
      alert("JavaScript function called, going to call VBScript function now...");
      callVB();
    function callJS() {
      alert("VBScript function called this JavaScript function!");
    -->
    </SCRIPT>
    </HEAD>
    <BODY>
    <INPUT TYPE=BUTTON LANGUAGE="VBScript" VALUE="with vb!" NAME="TestButton">
    <HR>
    <INPUT TYPE=BUTTON VALUE="with js!" onclick="doJS();">
    <HR>
    </BODY>
    </HTML>

  • How to select data into multiple bind variables

    Hi,
    I need to load data into multiple bind variable how to do that
    As of now i am using this
    select a , b into :a, :b from dual
    But i want even a to be loaded into both :a and :c also b to be loaded into :b and :d Please suggest
    Thanks
    Sudhir.

    Thanks much it worked
    Thanks
    Sudhir

  • I'cant load SPRY content into a Frame

    HOw can i load spry content into a frame.. i wrote a code..
    and in the preview version works.. but when i upload to server..
    it's not working.. this my code.. thk
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <!-- Copyright (c) 2006. Adobe Systems Incorporated. All
    rights reserved. -->
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Collapsible Panel Group Sample</title>
    <script language="JavaScript" type="text/javascript"
    src="widgets/collapsiblepanel/SpryCollapsiblePanel.js"></script>
    <script language="JavaScript" type="text/javascript">
    function load_content ()
    if (parent.document.getElementById('main_div')) {
    parent.document.getElementById('main_div').innerHTML=document.getElementById('inner_frame ').innerHTML;
    if (!parent.document.getElementById('main_div')) {
    window.location=('index.html') ;
    </script>
    <link
    href="widgets/collapsiblepanel/SpryCollapsiblePanel.css"
    rel="stylesheet" type="text/css" />
    <link href="css/samples.css" rel="stylesheet"
    type="text/css" />
    <style type="text/css">
    #cp1 .CollapsiblePanelContent {
    overflow: scroll;
    height: 300px;
    .CollapsiblePanel {
    width: 300px;
    .CollapsiblePanelTab {
    font-size: 1em;
    </style>
    </head>
    <body onload="load_content()">
    <h3>Collapsible Panel Group Sample</h3>
    <p>By default the panels in a collapsible panel group
    are open.</p>
    <div id="inner_frame">
    <div id="CollapsiblePanelGroup1"
    class="CollapsiblePanelGroup">
    <div class="CollapsiblePanel">
    <div class="CollapsiblePanelTab" tabindex="0">Panel
    23</div>
    <div class="CollapsiblePanelContent">
    <p>Test 1.</p>
    </div>
    </div>
    <div class="CollapsiblePanel">
    <div class="CollapsiblePanelTab" tabindex="0">Panel
    2</div>
    <div class="CollapsiblePanelContent">
    <p>test 2</p>
    </div>
    </div>
    <div class="CollapsiblePanel">
    <div class="CollapsiblePanelTab" tabindex="0">Panel
    3</div>
    <div class="CollapsiblePanelContent">
    <p>test 3</p>
    </div>
    </div>
    </div>
    </div>
    <script language="JavaScript" type="text/javascript">
    var cpg1 = new
    Spry.Widget.CollapsiblePanelGroup("CollapsiblePanelGroup1", {
    contentIsOpen: false });
    </script>
    </body>
    </html>

    Im not sure if i'm doing it right, but it wont work for me
    var scriptEle= document.createElement("script");
    scriptEle.text = s;
    ele.appendChild(scriptEle);
    is this the exact code witch i have to replace the old one
    with?
    i also added the
    Spry.Data.initRegions(ele);
    on the end of the Spry.Utils.setInnerHTML function
    i havent included the spry related javascripts in the main
    page could tha be a problem?
    actually i've tried to but it did'nt help
    really thanx tha you willing to help

  • How to pass a JavaScript variable into a java method

    I would like to know how to pass a JavaScript variable into a java method with in a <% %> tag inside a JSP file like so:
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
    <head>
    <script LANGUAGE="JavaScript">
    myValue = someDynamicValue;
    <% System.out.println(myValue)%>
    </script>
    </head>
    <body>
    </body>
    </html>
    obviously "System.out.println(myValue)" will not work because myValue is seen as a java variable and not a JavaScript variable.
    I would like to know how to let the jsp file, that I wrote in the above code, see myValue as a JavaScript variable and not a java variable so that I can pass it to a java method.
    NOTE: the java method does not have to be a println() method, it can be any method of my choice.
    NOTE: someDynamicValue is a JavaScript value that can dynamically change

    I don't believe you can. JSPs are really just elaborate templates that an engine such as Tomcat parses and generates an HTML page based on. That page is then displayed to the user. By the time you want to use some function in Javascript, the JSP has already been parsed and generated.
    Basically, Javascript and JSPs can't talk to each other. One's server-side and the other is client-side.

  • How to put a jsp variable into a javascript function?

    Please read the following coding. I want to pass the variable ans from jsp to the function check_answer() of javascript. ans is a string got from database. But I cannot put the variable ans into the Javascript function. Can anyone help?
    <script language="Javascript">
    function check_answer() {
    if (testing.result.value==ans ){
    window.alert("You have got 10 marks.");
    </script>
    <body>
    <form name="testing"...>
    <%
    ResultSet rs = stmt.executeQuery("select * from level where...");
    while(rs.next())
    out.println("<tr>");
    out.println("<td>" + rs.getString("question") + "</td>");
    ans = rs.getString("answer");
    out.println("</tr>");
    out.println("<input type='text' name='result'>);
    out.println("<input type='button' value='Enter' onclick='check_answer()'>");
    %>

    The following should be able to pass ans.
    <script language="Javascript">
    function check_answer(ans) {
    if (testing.result.value==ans ){
    window.alert("You have got 10 marks.");
    </script>
    <body>
    <form name="testing"...>
    <%
    ResultSet rs = stmt.executeQuery("select * from level where...");
    while(rs.next())
    out.println("<tr>");
    out.println("<td>" + rs.getString("question") + "</td>");
    ans = rs.getString("answer");
    out.println("</tr>");
    out.println("<input type='text' name='result'>);
    out.println("<input type='button' value='Enter' onclick='check_answer('<%= ans%>')'>");
    %>jag

  • Loading File name and file contents into two separate tables using Sqlloadr

    Hi All,
    I have situtation like to load File contents into One table and File name into one table . File comes with .txt extension
    Example :
    File name : product_09_abc.txt
    File contents :
    Productcode
    ABC
    CDE
    EFT
    Can you please help me out this how can we acheive this using SQLLOADER.

    SQL*Loader will not pass through the filename for you to be able to insert into a table.
    You will need to have a controlling o/s script that picks up the file name, calls sql*loader and then also call's an SQL script (using sql*plus?) to insert the filename into a.n.other table.

  • Load XML content into HTML enabled TextField

    I'm trying to figure out how to use html such as <br />
    loaded from an XML element into a TextField.. if I use something
    like
    <desc>my description<br />line 2</desc> I
    get 3 nodes instead of one when loading the XML file. If I use
    something like <desc>my description&lt;br /&gt;line
    2</desc> then I get <br /> in the actual text.
    Can anyone clue me in as to how to store HTML in an XML
    element so I can load the content into a Dynamic TextField with
    HTML enabled?
    Thanks much!

    use the latter in your xml and use the htmlText property of
    your html-enabled textfield to display your text.

Maybe you are looking for

  • Album Artwork / Cloud

    Hi, When I open Itunes or after I have made changes to the library i.e. Download purchases / matched songs, there is a background process that brings everything to a halt. This process lasts around 4/5 minutes. During this time I get the spinning bea

  • Sorry dont know enough for this..

    Just picked up a new airport extreme to connect my imac and macbook etc etc into our first home network. Plugged it all in - but in the set up its asking for a router address ? Whats this and where can I find it please. We connect to the internet via

  • PFD's and word docs sending as zipped, how to stop this?

    When I email docs to that were created in pages and then exported and saved as PDF's or word docs, the recipient gets them zipped and can't open them.  I have 'windows friendly docs' enabled.  Can anybody explain this please?

  • Multiplication of two columns in a row

    Hi All, I have created an advanced table. In this table i am having 'price' and 'quantity' columns. i want to multiply these two columns and display result in 'amount' column in the same row. Please let me know how can i approach this.. Regards, Mura

  • Getting rid of unwanted files

    Hi guys, Is there an application that deletes unwanted left behind files when you uninstall applications on your phone? Something like registry cleaner(phone version) Would creating a phone memory backup and then doing a soft reset on the phone help?