Changing .css property through external Javascript file?

Hi,
I'm trying to create all kinds of functions on an external .js file, so I can just call them in Edge multiple times with less coding. The thing is, after importing jQuery and my external Javascript file, some code works, but I get stuck at this part: changing the .css property of a symbol, more specifically, the "font-size" property. My current function is:
function setFont(textid,fontsize,originalWinWidth){ //textid: symbol's name; fontsize: current font size of this symbol; originalWinWidth: window size at the start of the animation
console.log("Set Font:");
//set the original font size
var originalFontSize = Math.round(originalWinWidth/fontsize);
console.log("Original Font Size: " + originalFontSize);
console.log("Text ID: " + textid);
//set the font size using jquery
sym.$(textid).css("font-size", originalFontSize);  }
I get an error at the last line, all other parts of the code works. Any idea what this could be?
Thanks,
Rafael Carignato

Have you tried sending textid to the console.log to make sure you're sending the actual name of the symbol and not a pointer to the symbol itself?
-Elaine

Similar Messages

  • Jspx and external javascript file (display empty page ?!?!)

    I have created a JSPX file...
    Now I want to add a javascript control to verify that only numbers are pressed from keyboard..
    This is a simple javascript function:
    function isNumberKey(evt)
    var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57))
    return false;
    return true;
    When I add a function directly to jspx I get error in phase of compile of the page...
    So I tryed to write an external javascript file with function above...
    In My jspx page i have put <script src="functions.js"></script> the tag has a reference to external javascript file...
    When I run the page I get "blank" page.. (it's like that all html code is a comment)..
    If I remove the script tag the page will display correctly...
    Is there any example how to include an external javascript file inside jspx?
    this is a piece of jspx:
    <f:view>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1250"/>
    <title></title>
    <link href="css/oracle.css" rel="stylesheet" media="screen"/>
    <script src="functions.js" type="text/javascript"></script>
    </head>
    ..

    Hi,
    you should not add
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1250"/>
    <title></title>
    <link href="css/oracle.css" rel="stylesheet" media="screen"/>
    <script src="functions.js" type="text/javascript"></script>
    </head>
    to f:view. There are JavaScript equivalents to this. Alternatively use
    <f:verbatim>
    <script src="functions.js" type="text/javascript"></script>
    </f:verbatim>
    I assume you use JDeveloper 10.1.3 because in JDeveloper 11 there are other options
    Frank

  • How to include external javascript file in an html

    hello
    i've an html file placed in apache/webapps/test folder this html file includes an external javascript file placed at same level
    i'm includind the file as
    <script src="file1.js"></script>but the file does not gets included
    but when the sam folder "test" is paste outside apache the html file including the external file runs properly.
    Thank You

    flounder wrote:
    cotton.m wrote:
    What's really pathetic is that this is your third cross post on this same stupid off topic topic.
    You are really a dumb f&#117;ck you know that?If they knew that they were a dumb f&#117;ck then they wouldn't be a dumb f&#117;ck!That's a logical and reasonable conclusion. Therefore I very much doubt that the OP is capable of it.
    Hmmm this is interesting. It now shows the entity escapes rather than their values when you quote.

  • Call External Javascript file in Custom Visual WebPart

     Hi..
     How to call external javascript file in Custom Visual WebPart in sharepoint 2010
    Ravindranath

    Hello,
    Download that script and save in layout folder or within a site. Then use below script tag in webpart:
    <SharePoint:ScriptLink ID="ScriptLink2" Name="location/jquery-1.5.min.js" runat="server" OnDemand="false" Localizable="false" />
    http://stackoverflow.com/questions/5068663/how-to-call-an-external-javascript-file-from-a-webpart
    http://stackoverflow.com/questions/5243821/external-javascript-file-in-sharepoint-web-part
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Invoking external javascript file from xdp source

    Is it possible to invoke an external javascript file from within the xdp source? I know it is possible to embed the javascript in the form.
    If this is possible, would I be correct in assuming that this is also possible from pdf source?
    Basically I am looking to show / hide buttons based on the status associated with a form at a given time in the flow. My understanding of PDFs is that the source cannot be edited once it has been created? If this is the case I was hoping that there could be code embedded that would call on the external file which would return the status of the letter. Based on the response buttons / fragments etc could be shown / hidden as required.
    Feedback required asap please!
    Thanks in advance.

    You cannot call outside of the rendered form. So you have a couple of means to get information into the form. Merge dat aonto the form (in your case you can use a field as a flag and key off of that),or use Web Service call to check the status.
    Hope that helps
    Paul

  • Targeting Edge from external javascript file

    Is it possible to target adobe edge build from an external Javascript file? For instance, I click a button outside of the edge animate project and javascript tells Edge animate to "play()". What would that syntax be?

    Yes, it is.  Read this post for some background information and a sample.
    http://forums.adobe.com/message/5289458#5289458
    -Elaine

  • Find Change through external text file

    Hello folks
    I am bit pretty in InDesign scripting so could you please look into this.
    How can i change any particular text field in Indesign CS3 document from text file.
    I do have find change script but for each InDesign document specific text file is assigned.
    So each time i have to modify find change GREP property that is also repetetive of work. Is there any way to get find change information should be extract from external text file.
    Many Tanks in advance

    In the FindChangeByList script, you could customize the function myFindFile(myFilePath) {...} as to search the FindChangeList text file in the document location rather than the script location. That's an example. The question is: given a document, where will you have the corresponding FindChangeList?
    @+
    Marc

  • How to change the suffix for externally edited files?

    Hi,
    How can I change the suffix Lightroom adds to externally edited files?
    If I want it to be "-E" instead of "-Edit" for example, or "-Mod" instead of the long and ugly "-Modifier" in french version.
    That would help me to get shorter filenames.
    Thank you!

    Preferences>External Editing tab
    Edit Externally File Naming: section
    Change the Template

  • Error while calling an external javascript file

    Hi,
    I have added a javascript file into the public_html folder, i have named it main.js.
    I have a html file in which i am referring to the javascript externally , this too is in my public_html folder. But the HTML page does not seem to be able to invoke the javascript.It does not even enter the method.
    My code is as follows
    html file
    <head>
    <title>untitled1</title>
    <script language="Javascript" src=\"\main.js\" type=\"text/javascript\"></SCRIPT>
    </head>
    <body>
    <form name="test" method="POST" action="test">
    <input type="button" value="submit" name="submit" onclick="analyze_page()">
    </form>
    </body>
    </head>
    main.js
    <script language="Javascript">
    function analyze_page(){
    alert("testing if it works");
    </script>
    (2)
    Secondly, I also have a servlet in a package com.oracle.prod, what is the path I should give in the servlet <SCRIPT> tag so that the javascript is accessible while the page gets rendered

    Hi Kart,
    Try to do:
    <script language="Javascript" src="<c:out value="${pageContext.request.contextPath}"/>main.js" type="text/javascript"></SCRIPT>
    In that way you can access the context path of your application.
    So, another thing that I noted is \" it's unecessary if you are editing directly a jsp/html file.
    Afonso

  • External javascript file not loaded

    Hi I am beginner with jquery ; I am following through with a tutorial;
    I have javascript file called default.aspx.js in the Scripts folder
    /// <reference path="jquery-1.4.1-vsdoc.js" />
    $(function() {
    $("div").click(function() {
    alert('');
    my webform is:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="javascriptweb.WebForm1" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title></title>
    <script src="Scripts/jquery-2.0.3.min.js" type="text/javascript"></script>
    <script src="Scripts/default.aspx.js" type="text/javascript"></script>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    Div #1
    </div>
    <div>
    Div #2
    </div>
    </form>
    </body>
    </html>
    nothing happens when I click the div;
    i also tried to make the javascript file just call alert upon  documnet ready but it did not work either
    any help will be most appreciated;
    i am using  google chrome 

    Hi,
    Thank you for posting in the MSDN forum.
    I’m afraid that it is not the correct forum for this issue, since this forum is to discuss the VS testing issue.
    Happy to see this issue has been resolved. For further research,
    I suggest that you can consult your issue on ASP.NET forum: http://forums.asp.net/
     for better solution and support.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Use function from external Javascript file

    Hi All,
    Is it possible to use function from other javascript file. If possible then please post some example.
    Shonky

    As Harbs mentioned, you can use doScript().
    Maybe you can do something like this:
    First I created simple function in separate file and exported it JSXBIN
    function myAlert(myString){
        alert(myString);
    Then, I copied contents of that JSXBIN and put it into variable
    var securedFUNCTION = app.doScript("@JSXBIN@ES@[email protected]AffABC40BhAB0AzHjNjZiBjMjFjSjUDAC0EzAEByB");
    or
    var securedFUNC = eval("@JSXBIN@ES@[email protected]AffABC40BhAB0AzHjNjZiBjMjFjSjUDAC0EzAEByB");
    And simply called function
    myAlert('My test String');
    Also, you can use include external script with #include to call JSXBIN, but you need to wrap contents of JSXBIN file into doScript or eval().
    tomaxxi
    http://indisnip.wordpress.com/

  • How to include external JavaScript files

    Hello All,
    i'm wondering haow can i include externel JavaScrip files, there is an clip-example with a function in the same JSP file
    but not how to include a file?
    <body>
    <script language='JavaScript' src="menu/menu.js'></script>
    If some one has a clip i would appreciate.
    Thanks
    Gino

    <script src="resources/myscript.js"></script>
    I did this exact thing in my jsp but it did not work, nothing popped up.
    When I tried replacing it with:
    <script language="JavaScript" type="text/javascript"><![CDATA[
    function postMessage(message) {
    alert(message);
    ]]></script>
    It worked. Can someone tell me why? Can't i refer to javascript files this way?

  • Including external Javascript file in JSP- not working on Mozilla Firefox

    I have a JSP page which includes javascript file as below:
    <script type="text/javascript" src="https://siteAddress/scripts/myJsFile.js"></script>
    myJsFile.js has a method testFireFox()
    There is a link on JSP which that calls this method.
    <a href="#" onClick="testFireFox()">Some Text...</a>
    As soon as i click on the link, nothing happens and this error appears on console:
    Refrence Error: testFirefox() is not definedI tried giving the path for JS file in various ways but it did not help.
    Note: This works absolutely fine in Internet Explorer.
    I have not added Javascript to document.ready or onLoad event. It is simply been referred in <Head>
    tag any pointers pls..

    This forum is intended for user support, not for web development issues.
    Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The contributors over there are more knowledgeable about web page development issues with Firefox.
    http://forums.mozillazine.org/viewforum.php?f=25
    You'll need to register and login to be able to post in that forum.

  • Developing site to use external javascript files for server access. my ain.js file just displays and does not execute. Why?

    My ain.js file is meant to work on and access server files for tracking all visitors to the site I am developing.
    One way to access it, in my plan, is to use index.htm. when I open index.htm it displays correctly and presents a link to ain.js with a query line (?a=zzzzz--e2).
    The entire file is displayed; but not executed.
    Short of building my own server (prior to publishing what I am developing) how do you propose I test what I have written?
    As a retiree, I have limited funds (the purpose of developing a website is meant to coorect that).

    This forum is for Firefox user support, very few of our contributors are developers.
    Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox. <br />
    http://forums.mozillazine.org/viewforum.php?f=25 <br />
    You'll need to register and login to be able to post in that forum.

  • How to  include external javascript and css resources to a jsf?

    I need to include external css and javascript files to my jsf page. Using the code below does not work because all the styles on the css page are ignored and the functions within the js files are not executed.
    <link rel="stylesheet" type="text/css" href="/resources/styles/style.css" />
    <script language="JavaScript" src="/resources/javascript/util.js"></script>When I try to execute any js function within a script tag on a jsf page I get an object expected error.
    I googled about my problem and found this piece of code for importing styles for an external css.
    <style type="text/css">
    @import url("/resources/styles/style.css");
    </style>How could I add an external javascript file to my jsf?

    Used the relative urls in my first post as well as these, and both were not working.
    <link rel="stylesheet" type="text/css" href="./resources/styles/style.css" />
    <script language="JavaScript" src="./resources/javascript/util.js"></script>The ./ tells that the external file can be found by starting at the current directory and working down the path to the specified file. This is my directory structure. Index.jsf is the file that references the external js and css files.
    -Webcontent
    |_index.jsf
    |_resources
    |__styles
    | |__style.css
    |__javascript
    |__util.js
    Either way I still can't reference the files that I need. Calling a javascript function results in an object expected error, and the styles are ignored.
    If I include the js file directly in the jsf then I can get it to work. I don't want to do this because I have created a handful of seperate js files, and do not want to include all of them in one page. I am using myfaces and tomahawk if that helps.

Maybe you are looking for

  • Null and empty string not being the same in object?

    Hello, I know that null and empty string are interpreted the same in oracle. However I discovered the strange behaviour concerning user defined objects: create or replace TYPE object AS OBJECT ( value VARCHAR2(2000) declare xml xmltype; obj object; b

  • How to open PDF file with the view I wish without many clicks

    I am getting many many scanned files daily and I'd like to able to skim thru each file as fast as possible. Since the way each file scanned is consistent, when I open it, I am clicking a button to rotate it counterclock, then click zoom-in a few time

  • Pages created with DWT will not scroll

    I recently acquired a contract to update a site built in CS2 with tables to something that's HTML 4.01 compliant. I'm using CS5 and have updated the DWT's design, but now my pages will not scroll using the new template. I've tried using the overflow

  • Widgets in dock enlarged

    Just today after having my Mac for about a year the Widgets in the dock are getting bigger when you move the mouse over them. I have no idea what cause dthis to happen any ideas why and how to change it back Thanks

  • Failing to create new SQL farm with FSconfig.exe for ADFS federation Services on an Azure SQL

    I'm building ADFS in Azure. My plan is to use the Azure SQL. The problem is that FSconfig seams not to work with Azure SQL. Here's what i did untill now: - I followed the documentation and created a new login and user (adfslogin, adfsuser) in a new "