Flash CC: use jQuery functions

I want to use jquery functions into flash for html5 game I am building. What I tried to do is add the following lines, and then use simple jquery function, but it seems not loaded, because I get the error: $ is not defined
My code, which is in the first frame of the main timeline, is:
var head = document.getElementsByTagName('head')[0];
var file = "http://code.jquery.com/jquery-1.11.0.min.js";
var ref = document.getElementsByTagName('script')[0];
var js = document.createElement('script');
js.src = file;
ref.parentNode.insertBefore(js, ref);
console.log(head.outerHTML);
console.log($(document).height());
console.log($(document).height());
The result I see in the console log, is the following:
<head>
      <meta charset="UTF-8">
      <title>ggg</title>
      <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script><script src="http://code.createjs.com/easeljs-0.7.1.min.js"></script>
     <script src="http://code.createjs.com/tweenjs-0.5.1.min.js"></script>
     <script src="http://code.createjs.com/movieclip-0.7.1.min.js"></script>
     <script src="ggg.js"></script>
     <script> var canvas, stage, exportRoot;
          function init()
               canvas = document.getElementById("canvas");
               exportRoot = new lib.ggg();
               stage = new createjs.Stage(canvas);
               stage.addChild(exportRoot); stage.update();
               createjs.Ticker.setFPS(lib.properties.fps);
               createjs.Ticker.addEventListener("tick", stage);
     </script> </head> ggg.js:163
> Uncaught ReferenceError: $ is not defined
What is wrong with that? and what I have to do so I can use jquery?
TIA

As shown in line 9 of the code above, I wrote: console.log ($ (document) .height ());
I did not think, I needed to set the variable $, because jquery is already doing it. Is not it?
If I try to write the line: <script src = "http://code.jquery.com/jquery-1.11.0.min.js"> </ script> within the <head> html file manually, then there is no problem and I get the height of the screen, even without defining the variable $.
Which brings me to the conclusion that, although the line was written in the file, as you can see in the console log, but it still does not start ...
The problem is, if I write the line in the html file manually, when I do publish .fla file, Flash CC erases the line and everything was written by hand. So I thought to write the above code from the first frame of the timeline.
Is there a better way?
And yet - why the above code tweaks error message?
TIA

Similar Messages

  • How to close a popup using a function key in adf + Jquery

    Hello All,
    I want to display some error message using function key so I have used javascript function
    *function showText(event) {*
    var k = event.getKeyCode();
    *if (k == 115) {*
    ------------------------------------------CODE-------------------------------------------
    This is working fine on click of F4 it is invoking a popup and inside that popup in dialog it is showing some error messages. The property modal of dialog is true. So that user should not be able to navigate to main form until error message is closed.
    Now on click of F6 I want that error message to be closed. When I added af:clientListener on popup or dialog type="keyDown" is not available.
    So I thought using jquery for this. I have created a form.js file inside that I have written:
    *$(function first()*
    *               jQuery('*').bind('keydown', 'F6', function (evt){closePopup();evt.stopPropagation();return false;});*
    *function closePopup(){*
    *     alert("Do you want to close the error message");*
    I have also added jquery.hotkeys.js and jquery-latest.js file.
    My question here is How can i find that popup or dialog inside that jquery function and close it?
    On click of F6 I am getting that alert Do you want to close the error message but after that how can I find the popup or dialog and close it?
    I am new to jquery still I tried using some code:
    var dialog = event.getSource();
    var popup = dialog.findComponent("p1");
    popup.close();
    and
    var output1 = AdfUIComponent.findComponent("p1");
    output1.close();
    and
    curElm = document.activeElement;
    var frm = curElm.close();
    But none of them worked.
    Please help
    Thanks

    Hi,
    this whitepaper: http://www.oracle.com/technetwork/developer-tools/jdev/1-2011-javascript-302460.pdf has an example of registering keyboard keys on a global level (see page 36). So you would define a key to close dialogs in general. The paper also explains how to search and find components. Note that you should always work with the ADF Faces client side API and never against the generated markup or DOM (which in fact your code does)
    Frank

  • What are the implications of using jquery version 1.10.2 rather than the version (1.7.1) that Adobe

    What are the implications of using jquery version 1.10.2 rather than the version (1.7.1) that Adobe uses? Thanks
    Bob

    I am having trouble when my Edge Animate composition (banner ad) appears on a web page that uses jquery version 1.8.23. Some of the functionality of the host page no longer works. This occurs only when my composition is present & the functionality returns when another ad is displayed (either a Flash ad or a gif). It happens in Chrome Version 31.0.1650.63 m, Chrome Version 33.0.1738.0 canary & IE 11.
    I had edited my Edge Animate files to use the Adobe CDN option & to point to another server (mine) so only the html file was needed to be placed in the ad rotator & on the host's server. I now have edited them again to include the Google CDN locations for version jquery 1.10.2 (http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js). I am waiting for the host site to try this updated html file. When I visit just this new page & the old one that pointed to 1.7.1 for that matter, it works fine.
    Thank you for taking the time to read and answer my message.
    Bob

  • How to read XSLT list item of a list view web part in SharePoint designer 2010 using jquery

    Hi ,
    I have a requirement to get data from one list(e.g., A) and display in some other list's(e.g.,B) custom display form(e.g., CustomDispForm.aspx). 
    Here I am going to do this with the help of Jquery SP Services using GetListItems(). For getting the data I need to pass two parameters from list(B), but the data is like <xsl:value-of select="@testField_"/> .
    I have stuck how to pass such variables in Jquery function.
    Please let me know how to achieve .
    Thanks in Advance.

    Follow below code to pass variables to jQuery function in xslt. It will better to use parameters.
    <xsl:variable name="varTestFields">
    <xsl:value-of select="@TestField_"/>
    </xsl:variable>
    <!-- jQuery Function - Check the passing of parameters -->
    jQueryFunction('{varTestFields}'
    OR
    <!-- jQuery Function - Check the passing of parameters -->
    jQueryFunction('{@TestFields_}'
    Adnan Amin MCT, SharePoint Architect | If you find this post useful kindly please mark it as an answer :)

  • JQuery function stops working when trying to submit large amount of parameters

    Hi,
    Run CF9 on Windows 2008 R2 Server.
    I have a cfm page with multiple dropdowns (some are cfselect) and dynamically generated lists of checkboxes interdependent on each other. I am using JQuery to submit data to cfc functions and to display data.
    It was all working fine until we added new company with large number of records. This translated into large URL query string with a lot of parameters submitted for processing. That's when we started to have problems. I noticed when trying to directly submitting URL, if the total number of characters in URL is more than 2114 I get an error status code 302 Redirect and nothing is displayed. 
    I tried to play with postParametersLimit and postSizeLimit increasing to 1000.0 in neo-runtime.xml and restarting server but, this did not help.
    Below is jquery function:
    function populateBills(){
       var plID;
       if ($('#planenrolldate_id').val() == undefined)
        plID = $('input[name=planenrolldate_id]').val();
       else
        plID = $('#planenrolldate_id').val();
       var sID = $('#sponsor_id').val();
       var pID = $('#plan_id').val();
       var fromMonth = $('#from_month').val();
       var fromYear = $('#from_year').val();
       var toMonth = $('#to_month').val();
       var toYear = $('#to_year').val();
       $.ajax({
        type:"POST",
        url:"../components/billing/custompremstatus.cfc?method=GetBillsArr&planenrolldate_id=" + plID + "&sponsorid=" + sID + "&fM=" + fromMonth + "&fY=" + fromYear + "&tM=" + toMonth + "&tY=" + toYear,
        dataType: "json",         
        success:
         function(data){                 
          $.each(data, function(index, item) {
           addBillsCheckboxes(item.bill_id,item.bill_period);
        }, //end the error function
        error:
         function(){
          alert("An error has occurred while fetching bills");
         } //end the error function
       }); // end ajax call      
      } // end of function

    That's exactly from the console after I submit:
    fM  9
    fY  2014
    method  GetBillsArr
    planenrolldate_id[] 564
    planenrolldate_id[] 561
    sponsor_id  59
    tM  9
    tY  2014
    When I check just one planenrolldate_id then it looks like this
    fM  9
    fY  2014
    method  GetBillsArr
    planenrolldate_id[] 561
    sponsor_id  59
    tM  9
    tY  2014
    This it cfc part:
    <cffunction name="GetBillsArr" access="remote" returnFormat="json" returnType="array">
            <cfargument name="sponsor_id" type="any" required="true">
            <cfargument name="planenrolldate_id" type="any" required="true">
            <cfargument name="fM" type="numeric" required="true">
            <cfargument name="fY" type="numeric" required="true">
            <cfargument name="tM" type="numeric" required="true">
            <cfargument name="tY" type="numeric" required="true">
            <cfset var result=ArrayNew(1)>
            <cfset var i = 0>
             <cfif ARGUMENTS.planenrolldate_id EQ "" OR ARGUMENTS.sponsor_id EQ "">
                <cfset LstBills = QueryNew("bill_id, bill_period", "Integer, Varchar")>
            <cfelse>
                <cfquery name="LstBills" ...>
                    SELECT bill_id,
                        (Convert(varchar(10),billing_start_date,103) + ' - ' + Convert(varchar(10),billing_end_date,103)) + ' [' + Convert(varchar(6),plan_id) + ']' AS bill_period
                        FROM ...
                </cfquery>           
            </cfif>
            <cfloop query="LstBills">
                <cfset returnStruct = StructNew()>
                <cfset returnStruct["bill_id"]= bill_id>
                 <cfset returnStruct["bill_period"] = bill_period>
                 <cfset ArrayAppend(result,returnStruct) />
            </cfloop>
            <cfreturn result>
    </cffunction>

  • Setting row level field in table using jQuery

    Hi,
    I'm utilising the following to read and then set values in the same row within a report.
    Re: Referencing a row level field value in an Interactive Report using jquery
    Consider the following snippet
    // read information eg
    var row = $x_UpTill(this.triggeringElement, 'TR');
    var dateCompleted = $('input[name="f03"]', row)[0];
    console.log(dateCompleted.value);
    // write information eg
    var dateBooked = $('input[name="f02"]', row)[0];
    //dateBooked.value = 'xyz'; // sets to xyz, as expected
    dateBooked.value = return_date; // sets the actual code, not returning stringAll works as I'd expect except the last line. I have a js function returning a formatted string (Set Date With Javascript but in this case my field now contains the actual code definition, not the date string the function actually returns.
    I'm thinking I'm just misunderstanding a simple concept for JavaScript here?
    A simple workaround could be to create field P0_SYSDATE, calculated to TO_CHAR(SYSDATE,:F_DATE_FORMAT), then apply
    dateBooked.value = $v('P0_SYSDATE');but I'm trying to improve my understanding of javascript/jQuery...
    Cheers,
    Scott

    So are you saying that return_date is an actual javascript function that returns the formated string/date you want?
    If so, then I think you simply need parenthesis to run the function:
    dateBooked.value = return_date();Or... am I missing something here?
    Thanks
    -Jorge

  • Tracing Captivate 4 variables in Flash CS4 using AS3

    Hello. I've googled this 9 ways to Sunday and can't find an answer. I'm hoping one of you can help.
    I have a very simple Captivate 4 quiz with one question. I embed the Captivate SWF file in a Flash file, which plays fine. However I am struggling with tracing one of the Captivate variables in the Flash file using AS3.
    All I want is for Flash to read the Captivate variables so I can continue developing my quiz in Flash (building additional functionality Captivate does not provide).
    The variable I'm attempting to trace is cpInfoAuthor.
    I've attempted:
    trace(root.cpInfoAuthor);
    trace(root.movie.cpInfoAuthor);
    var cpAuthor = MovieClip(root).cpInfoAuthor;
    All of the above examples error out: TypeError: Error #1009: Cannot access a property or method of a null object reference.
    Captivate preferences are set to publish in AS3.
    Anyone with an explanation?
    Be splendid, Jodie.

    Hi Jodie,
    I'm not exactly 100% proficient in AS3 but to me it looks like your statements are wrong.
    Since you are loading your Captivate SWF into a Flash SWF then (root) actually refers to your Flash SWF. I guess that you are loading your Captivate SWF into a movieclip on your Flash stage and that movieclip has an instance name,
    You would therefore need to grab the variables like var cpAuthor = yourLoaderMovieClip.cpInfoAuthor;
    See if that doesn't do the trick for you.
    /Michael
    Visit my Captivate blog with tips & tricks, tutorials and Widgets.

  • Using jquery to upload files

    Hi
    I have uploaded files before but not using jquery but now am trying to use jquery so that my files uploads without page refreshing.
    This is my Jquery code. and below is the html code. Can any one help me with the jquery code so that I can get the data to the php script that process
    the variables.
    JQUERY:
    <script type="text/javascript">
    $(document).ready(function() {
       $("#photoform").submit(function() {
                                var phototitle = $("phototitle").val();
                                var photogenre = $("photogenre").val();
                                var photodesc = $("photodesc").val();
                                var photofield = $("photofield").val();
        $.post("Uploadfix.php", { phototitle: phototitle,
         photogenre: photogenre, photodesc: photodesc, photofield: photofield}, function(data) {
         $("#allresult").html(data);
       return false;
    //-->
    </script>
    PHP CODE:
    $phototitle=addslashes(strip_tags($_POST['phototitle']));
    $photogenre=addslashes(strip_tags($_POST['photogenre']));
    $photodesc=addslashes(strip_tags($_POST['photodesc']));
    $photo=$_FILES["photofield"]["name"];
    $type=$_FILES["photofield"]["type"];
    $size=$_FILES["photofield"]["size"];
    $temp_name=$_FILES["photofield"]["tmp_name"];
    $error=$_FILES["photofield"]["error"];
    echo "$phototitle";
    echo "<br/>";
    echo "$photo";
    echo "<br/>";
    echo "$type";
    echo "<br/>";
    html:
    <form id="photoform" method="post" enctype="multipart/form-data" action=''>
    //id variables:
    </form>
    How can I read in the file from jquery to the php sucessfully. NO SUCESS YET!
    Thanks.

    Hi Gramps
    Thank for the reply. If I use form action like the code below it works but I can not do validation.
    <script type="text/javascript" >
    /* $(document).ready(function() {
                $("#photoform").submit(function(e)         {
                $("#allresult").html('');
                $("#allresult").html('<img src="PHOTOTEST/loader.gif" alt="Uploading...."/>');
                $("#photoform").ajaxForm({
                            target: '#allresult'
            }).submit();
    </script>
    HTML:
    <form id='photoform' enctype='multipart/form-data' method='post' action='process.php'>
    </form>
    PHP:
    $example=$_POST['INPUT'];
    if($example>5)
    echo "input greater than 5 sorry.";
    else
    //process data
    The problem is this is echoed in a new page which is process.php. Instead of on a div on the page that is submitting the form. I know this is
    because of the form action. how can I make the validation appear on a div on same page?
    cheers.

  • How to use jquery.hotkeys.js in ADF application

    Hello all,
    I am developing an ADF application where i am trying to use jquery.hotkeys.js file. I have created a folder js inside ViewController\Web Content\js and i have added jquery.hotkeys.js file inside that folder.
    Now i have created a jspx page and inside that i have 3 input text and 1 submit button now I am trying to use keyboard shortcuts say ALT+F8 to clear the form fields. Here is my full jspx form
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:inputText label="First Name" id="it1" value="#{MyBean2.firstName}">
    <af:clientListener method="clearAll" type="keyDown"/>
    </af:inputText>
    <af:inputText label="Last Name" id="it2" value="#{MyBean2.lastName}">
    <af:clientListener method="clearAll" type="keyDown"/>
    </af:inputText>
    <af:inputText label="EmailID" id="it3" value="#{MyBean2.emailId}">
    <af:clientListener method="clearAll" type="keyDown"/>
    </af:inputText>
    <af:commandButton text="Submit" id="cb1"
    action="#{MyBean2.callSubmit}"
    binding="#{MyBean2.cb1}">
    <af:clientListener method="clearAll" type="keyDown"/>
    </af:commandButton>
    </af:form>
    <f:facet name="metaContainer">
    <af:resource type="javascript" source="/js/jquery.hotkeys.js"/>
    <af:resource type="javascript">
    function clearAll() {
    $("*").bind('keydown', 'Alt+F8', function (evt) {
    clearForm();
    evt.stopPropagation();
    return false;
    function clearForm() {
    alert('3');
    curElm = document.activeElement;
    var frm = $(curElm).closest('form');
    var frmname = ($(frm).attr('name'));
    document.forms[frmname].reset();
    document.getElementById('frmname::content').reset();
    document.getElementById('f1::content').reset();
    $("input:visible:enabled:first").focus();
    </af:resource>
    </f:facet>
    </af:document>
    </f:view>
    </jsp:root>
    But that is not working. Can anyone help?
    Thanks

    My requirement is the form should get cleared on pressing ALT + F8.
    Here is my updated jspx page:-
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:inputText label="First Name" id="it1" value="#{MyBean2.firstName}">
    </af:inputText>
    <af:inputText label="Last Name" id="it2" value="#{MyBean2.lastName}">
    </af:inputText>
    <af:inputText label="EmailID" id="it3" value="#{MyBean2.emailId}">
    <af:clientListener method="clearAll" type="keyDown"/>
    </af:inputText>
    <af:commandButton text="Submit" id="cb1"
    action="#{MyBean2.callSubmit}"
    binding="#{MyBean2.cb1}">
    <af:clientListener method="clearAll" type="keyDown"/>
    </af:commandButton>
    </af:form>
    <f:facet name="metaContainer">
    <af:resource type="javascript" source="/js/jquery.hotkeys.js"/>
    <af:resource type="javascript" source="/js/jquery-1.4.4.min.js"/>
    <af:resource type="javascript">
    function clearAll() {
    jQuery('*').bind('keydown', 'Alt+F8', function (evt) {
    clearForm();
    evt.stopPropagation();
    return false;
    function clearForm() {
    curElm = document.activeElement;
    var frm = $(curElm).closest('form');
    var frmname = ($(frm).attr('name'));
    alert(frmname);
    document.forms[frmname].reset();
    $("input:visible:enabled:first").focus();
    </af:resource>
    </f:facet>
    </af:document>
    </f:view>
    </jsp:root>
    But still I am not able to get the desired functionality. Am i missing something here?
    Thanks

  • How to use Jquery Data Grid in HTML

    can anyone please tell me how to use JQuery Data grid in my HTML page with example.
    I have one HTML page i want the standard JQuery Data Grid with search and pagination functionality.

    Guys I have got the solution
    thanks a lot
    please refer this link for JQGrid
    http://www.codeproject.com/Articles/609442/Using-JqGrid-in-ASP-NET

  • Using jQuery UI in a timeline trigger

    I am successfully using jQuery in timeline triggers, but something is going wrong when I try to use jQuery UI.
    I am loading jquery-ui-1.9.2.custom.js and jquery-ui-1.9.2.custom.css using yepnope in the creationComplete event for the stage object ("Symbol").  The same code that works in the "complete" function of the yepnope does not work in a timeline trigger.  The code is:
    sym.$("main_st_classic").hide("blind", { direction: "horizontal" }, 2000);
    So this is what it looks like bound to the default timeline:
          Symbol.bindTriggerAction(compId, symbolName, "Default Timeline", 0, function(sym, e) {
             // insert code here
             sym.$("main_st_classic").hide("blind", { direction: "horizontal" }, 2000);
    BTW, in the picture below the display property is set to Always On, but I have tried it with On and experienced the same problem.
    Any thoughts will be much appreciated.

    Umpf, my fault. DDL statements execute implicit commit.
    You need to execute your DDL statements in a separate transaction and not within the trigger transaction
    Try this:
    create or replace procedure create_user(p_username in varchar2, p_password in varchar2)
    is
      pragma AUTONOMOUS_TRANSACTION;
    begin
      execute immediate('CREATE USER '|| p_username ||
                        ' IDENTIFIED BY '|| password ||
                        ' DEFAULT TABLESPACE MAGICOP QUOTA UNLIMITED ON MAGICOP');
      execute immediate('GRANT APP_USERS TO '||p_username); 
      execute immediate('ALTER USER '||p_username ||' DEFAULT ROLE ALL');
    end;
    CREATE OR REPLACE TRIGGER NORDISKADMIN.BIU_LOGIN_JV
    BEFORE UPDATE OR INSERT ON LOGIN_JV
    FOR EACH ROW
    DECLARE
    BEGIN
      GETSTDTRIGGERINFO( inserting,'LOGIN_JV', :new.US_INSERT,:new.DT_INSERT,:new.US_MODIFY,:new.DT_MODIFY,:new.AI_LOGIN_JV);
      create_user(:new.CD_LOGIN_JV, :new.PW_LOGIN_JV );
    END;

  • How can i use jquery code in ExtendedRenderKitService?

    i'm try to using jquery like this way,but cause js error.
    so,can i use jqeury code in ExtendedRenderKitService? how?
    private String jsFunction() {
    StringBuilder sb = new StringBuilder();
    sb.append("$(document).ready(function(){");
    sb.append("var spans = $('span');");
    sb.append("alert(spans.length);");
    sb.append(" });");
    return sb.toString();
    public void searchTree(ActionEvent actionEvent) {
    favoriteTreeManager.searchTree(searchCriterium);
    FacesContext context = FacesContext.getCurrentInstance();
    ExtendedRenderKitService extRenderKitSrvc =
    Service.getRenderKitService(context, ExtendedRenderKitService.class);
    extRenderKitSrvc.addScript(context,
    jsFunction());
    }

    Hi,
    $('span') is invoked when the page renders if I remember correctly. Since using JavaScript from a managed bean invokes a function, the use of JQuery does not work. You can run a little test. If you get JQuery working from a URL browser typing javascript:... command ... then the same probably works from a managed bean
    Frank

  • Problem in call onpremise web service from o365 using jquery ajax

    I am trying
    to consume an onpremise web  service from the o365 site page using
    jquery ajax and it's giving me following error:<o:p></o:p>
     "Error:
    Operation aborted<o:p></o:p>
    Here is the
    code:<o:p></o:p>
     <o:p></o:p>
    jQuery.support.cors
    = true;<o:p></o:p>
              $.ajax<o:p></o:p>
    ({    <o:p></o:p>
    type: "POST",
                   <o:p></o:p>
     url: 'http://**************/WebService.asmx/CreateFolder',
                 <o:p></o:p>
    data: "{'PartId':'"+partnerid+"'}",
                  <o:p></o:p>
    contentType: "application/jsonp; charset=utf-8",
                  <o:p></o:p>
    dataType: "jsonp",
                 <o:p></o:p>
    username: "*****************",
                  <o:p></o:p>
    password: "******************",<o:p></o:p>
      success:
    function (msg) { $("#divResult").html("Success"); },
                <o:p></o:p>
       error:
    function (xhr, status, error){  console.log(error);
    console.log(status); }
              <o:p></o:p>
    });<o:p></o:p>
    Any
    help would be greatly appreciated.Thanks.<o:p></o:p>

    Where exactly you are trying to create folder
    This will work on both Office 365 and on prem
    http://www.c-sharpcorner.com/UploadFile/0e18a8/create-a-folder-in-document-library-in-sharepoint-2013-using/
    var context = SP.ClientContext.get_current();
    //gets the current context
    var web = context.get_web();
    //gets the web object
    var list = web.get_lists();
    //gets the collection of lists
    var targetList;
    var itemCreation;
    function createFolder() {
        targetList = list.getByTitle("MyDocumentLibrary");
        itemCreation =
    new SP.ListItemCreationInformation();
        itemCreation.set_underlyingObjectType(SP.FileSystemObjectType.folder);
        itemCreation.set_leafName("MyCustomFolder");
        var folderItem = targetList.addItem(itemCreation);
        folderItem.update();
        context.load(folderItem);
        context.executeQueryAsync(onFolderCreationSuccess, onFolderCreationFail);

  • Using JQuery In Apex

    I am using Apex 4.1
    I am trying to animate a list, so wanted to use JQuery
    So I edited my page and placed the following in Javascript box.
    $(function() {
            $("#MAIN").show("slide", { direction: "up" }, 500);
    }); I gave my list region the id MAIN.
    Unfortunately the animation does not work.
    I believe the Jquery file required to make this work is jQuery UI Effects, which I believe is loaded automatically in Apex 4
    or am I wrong
    Cheers
    Gus

    Gus C wrote:
    I have now placed the following in to my page template
    <script src="#IMAGE_PREFIX#libraries/jquery-ui/1.8.14/ui/minified/jquery.ui.effects.core.js" type="text/javascript"></script>
    <script src="#IMAGE_PREFIX#libraries/jquery-ui/1.8.14/ui/minified/jquery.ui.effects.slide.js" type="text/javascript"></script>Still nothing
    GusThe problem is in your paths that has file names spelled wrongly and also the point you are loading the files is before the *#HEAD#* tag, these files should be loaded after the *#HEAD#* tag because the actual jQuery file is loaded at that point by APEX
    You should load the files with these names
    <script src="#IMAGE_PREFIX#libraries/jquery-ui/1.8.14/ui/minified/jquery.effects.core.min.js" type="text/javascript"></script>
    <script src="#IMAGE_PREFIX#libraries/jquery-ui/1.8.14/ui/minified/jquery.effects.slide.min.js" type="text/javascript"></script>Check your app/page now
    Edited by: VC on Jun 21, 2012 9:22 AM

  • Create Records through OData using Jquery

    Hi All,
    I have created a OData Service in SAP ECC system in format
    http://hostname:portno/sap/opu/odata/sap/Z_PORDER_SRV/PurchaseOrderHeaderCollection
    I am trying to create a record from front end using JQuery.   I am able to retrieve all the records, but creation of records using Method "POST" fails.
    For creating records, using the method "GET", i fetch the token "X-CSRF-Token" and then pass the token to the "POST" method.
    I am getting an Exception "No Handler for Data" error is coming.   I am accessing the OData Service using the datajs framework.
    (datajs-1.1.1.min.js).
    Please help me in resolving this issue.
    Thanks,
    Divya

    Thanks for the reply Jamie.
    Code:
    OData.request({
                   "http://host:port/sap/opu/odata/sap/Z_PORDER_SRV/PurchaseOrderHeaderCollection",     
                    method : "GET",
                    user: Customer_Username, 
                    password: Customer_Password,
                    headers :
                           "X-Requested-With" : "XMLHttpRequest",
                            "Content-Type" : "application/XML",
                           "DataServiceVersion" : "2.0",
                           "X-CSRF-Token" : "Fetch"
              function(data, response)
                            var header_xcsrf_token = response.headers['x-csrf-token'];
                            OData.request(
                                    requestUri :    "http://host:portno/sap/opu/odata/sap/Z_PORDER_SRV/PurchaseOrderHeaderCollection",                     
                                    method : "POST",                 
                                    user: Customer_Username, 
                                    password: Customer_Password, 
                                    headers :
                                           "X-Requested-With" : "XMLHttpRequest",
                                          "Content-Type" : "application/XML",
                                          "DataServiceVersion" : "2.0",                      
                                          "X-CSRF-Token" : header_xcsrf_token
                                  data: 
                                     PONumber:"4500000091",
                                     CompanyCode:"TVSC",
                                     PurchaseDocCategory:"F",
                                     PurchaseDocType:"NB",
                                     PurchaseDocStatus:"9", 
                                     CreatedBy: "", 
                                     VendorAccountNumber:"V1",
                                     PurchaseOrganization:"PO01",
                                     PurchaseOrgGroup:"101",                      
                                     TotalValueAtRelase:"0.00",
                                      POItem: "00010",
                                      Material:"",
                                      MaterialNumber: "000000000000000011",
                                      Plant: "PL01",
                                      MaterialGroup: "01",
                                      TargetQuantity: "0.000",
                                      Quantity: "5.000",
                                      Unit: "ST",
                                      OrderPriceUnit:"ST",
                                      NetPrice: "10.0000",
                                      PriceUnit:1,
                                      GrossValue:"0.0000",
                                      NetValue:"0.0000",
                                      NetWeight:"0.000",
                                      WeightUnit:"",
                                     MaterialType:"",
                                     PurchaseOrderHeaderPONumber:"",
                                     PurchaseOrderHeaderPONumber1:""
                      function(data,response)
                           alert('Success. Created New Record');
                      function(err1)
                          alert('Error in Create Record...'+err1.message);
                     function(err)
                            alert('error....'+err.message);
    Output
    I get an error message "Error in Create Record. "No Handler for Data".
    I tried entering the header  details alone and also by entering the line items. Still the same error is thrown.
    Please Help.
    Thanks,
    Divya

Maybe you are looking for

  • Selling a 2007 Mac Pro

    I'm getting ready to sell my 2007 Mac Pro. I've researched the process of cleaning the disk and came across a posting that included a link to a Safe Mac article entitled "How to prepare your Mac for sale" which recommends using the original install d

  • Are the new 27" iMacs showing up in the Apple Stores yet?

    Impoosible to call a store ask someone if they have any available for purchase. I am just looking for a plain stock unit but I would like to spend the money this year so ordering doesn't look like an option.

  • How to refresh table output?

    hi experts,              i have three column in table .                    one as textview with text,                    second one as button and                    third one is as textview as null. What my case is: when user click on button ( second

  • How to view photos on Nano

    I have a photo saved on my Nano but I can't seem to view the photo. All I can get to is the slideshow preferences. Help!

  • Blackberry Curve 8310 and New Macbook Pro

    I have a year old 8310 and a brand new Macbook Pro. I have downloaded Pocket Mac for Blackberry but my Macbook will not recognize my 8310. I have been told that BB is working on a fix, but does anyone have a time frame? I really don't want to wait un