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

Similar Messages

  • How to call external js file to custom master page

    Hi all,
    I have created custom master page and i need to call external .js to master page. i tried every aspect of including this in master page. but this js is not running. 
    <script src="test.js" type="text/javascript"></script>
    i have put the above calling js script to head tag. 
    And, When i am running the site, the js file is not loading. 
    How to load this js file to custom master page. 
    Thanks,
    Rakesh

    I have placed js file in same folder of custom master page. 
    This is quite annoying and i am struggling to call it. 
    js file is in same master page folder still i am calling it through whole URL as
    <script type="text/javascript" language="javascript" src="http://SharePoint/sites/SiteName/_catalogs/masterpage/Master%20Page%20Template/test.js"></script>
    Still it is not working.
    Now i am not sure what is wrong here. 
    Please help..
    Thanks in adv !!
    Rakesh

  • 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

  • Having problem with calling external javascript functions in LV

    Hi,
    I found this VI: http://lavag.org/topic/10304-discuss-calling-external-javascript/, which I believe can be really helpful for my work. The problem is I can't get it to run based on the following problem:
     - Apparently the "ScriptControl" cannot be loaded
    I am using LabView 8.6, and this vi has been produced in a 8.0 version. Do you think this is the problem? If not, what could cause this problem running this VI?
    Thanks,
    Diogo

    Hi,
    To start I am using this examplo from the google code page.
    <!DOCTYPE html "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
        <title>Google Maps JavaScript API Example</title>
        <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=abcdefg&sensor=true_or_false"
                type="text/javascript"></script>
        <script type="text/javascript">
        function initialize() {
          if (GBrowserIsCompatible()) {
            var map = new GMap2(document.getElementById("map_canvas"));
            map.setCenter(new GLatLng(37.4419, -122.1419), 13);
            map.setUIToDefault();
        </script>
      </head>
      <body onload="initialize()" onunload="GUnload()">
        <div id="map_canvas" style="width: 500px; height: 300px"></div>
      </body>
    </html>  
    It loads a basic map, and is saved in a html file created for example in Notepad. Basically as I said the VI is very simple, see next image.
    But like I said, this strategy does not allow labview to interface dinamically with the javasscript code in the html file. Doing it this way, I would have to constantly update the code in the file with new coordinates and loading the map again. This causes the mentioned flickering problem that I also had with static maps.
    Diogo

  • 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

  • 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.

  • How to call the javascript file through sdk?

    I created a plugin through SDK. Now i need to call my javascript file in that plugin code(c++). Could you please advice me with some samples. This is for "Illustrator CS".
    Thanks,
    Prabudass

    I haven't the foggiest idea, except to perhaps suggest firing a script by using the AIActionManager::PlayAction command. That's assuming you can 'action' the use of a script though. If you can, it should be possible that way, if not, I have no idea.

  • How to call that javascript file?

    I developed javascript for automated pdf files. But i don't know how to call that javascript file from outside of acrobat. Kindly advice me the various way to use that script. This is for acrobat 8.0 for windows platform.

    You can place Acrobat JavaScripts in various form elements, document actions, documents, and the application folder or user application folder. See the Acrobat JavaScript API Reference and Guide fo rmore information, http://www.adobe.com/devnet/acrobat/javascript.html .
    From within Acrobat's JavaScript's debugging console, one can use the following code to locate the JavaScript folders used by Acrobat/Reader:
    function JSInfo() {
    /* define function to report JS information */
    // some basic system information
    console.println(app.viewerType + ' ' + app.viewerVersion + ' is running on ' + app.platform);
    // user level script folder
    try {
    var userJS = 'User level JS folder: ' + app.getPath("user","javascript");
    } catch(e) {
    var userJS = "User has not defined use JS folder level scripts";
    console.println(userJS);
    // application level script folder
    try {
    var appJS = 'Application level JS folder: ' + app.getPath("app","javascript");
    } catch(e) {
    var appJS = "There are no defined application level JS folder level scripts";
    console.println(appJS);
    return;
    } // end of JSInfo function
    JSInfo(); // call the function

  • 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

  • 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

  • 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

  • Insert SWF that calls external XML files and images

    Hi
    I am using Acrobat XI Pro on a Windows 7 system.
    I have a PDF in which I have an SWF file. This SWF file contains text content that is called from an XML file and also some images that is called externally. I have added the folder that contains the XML file and the images by right-clicking the SWF > Properties > Resources > Add Directory. However, none of the content is loading.
    I have tried adding the images and xml file separately as well. Even that did not work.
    What could be wrong? Please advise.
    Sreekanth

    Debugging Flash content in a PDF from the Flash Pro or Flex editor is possible, but it's complicated (you need to juggle about with the SDK to load a special Acrobat plugin). If you're creating these SWFs yourself, the fastest way to debug is to add a bunch of ActionScript calls that report to Acrobat's console to tell you what's going on. Use ActionScript's externalInterface.call() and the Acrobat JS console.println() functions, just like if you were talking to JavaScript in a web page.
    Rich media resources cannot be imported globally in Acrobat. In theory it's possible (the ISO standard allows XObject references to shared assets) but there's no authoring tool.

  • 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 call external jar files in EJB project for CE

    Hi,
    I would be thankful if someone could help me with this -
    I need to call the external jar files into my EJB project - Here is what I have done and am getting runtime exception as  -
    java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/glance/pdf/pt/PTDoc
    1. Created a EJB  project" HelloWorld "  using Java perspective in NWDS 7.1 called with client as HelloWorldClient and EAR project as HelloWorldEAR.
    2. Am working on HelloWorld project (1st one).
    3. In my code I am instantiating a class which is a class in one of  the external jar file that I need to refer in my project.
    4. I have set the Java Build path but it works only for the compile time and fails during runtime.
    5. Have read I need to create external library DC and refer in my project "HelloWorld".
    Can anyone help me with exact steps what needs to be done - during creation of external library project and then for my "HelloWorld" EJB project. How would I be able to reference or set the external library project in my EJB project?
    Looking forward to hear from experts.
    Thanks,
    Shiv
    Edited by: Shiv Khullar on Aug 30, 2010 9:39 PM

    Hi Edson,
    I tried it , but it still gives me runtime exception.
    javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/glance/pdf/pt/PTDoc
    java.lang.RuntimeException: java.lang.NoClassDefFoundError: com/glance/pdf/pt/PTDoc
    Steps I performed are -
    1. Created a library project and created 2 Public parts "Compilation" and "Assembly"
    2. Build the library project.
    Now in my EJB project using Project Explorer - set the classpath and added both compilation jar and assembly jar files.
    This is how the classpath entries for external library looks like -
    <classpathentry kind="lib" path="/LocalDevelopmentLocalDevelopmentexternallibrarypdftoolsforwatermarkingdemo.sap.com/gen/default/public/WatermarkAssembly/lib/java/demo.sap.comexternallibrarypdftoolsforwatermarking~WatermarkAssembly.jar"/>
         <classpathentry kind="lib" path="/LocalDevelopmentLocalDevelopmentexternallibrarypdftoolsforwatermarkingdemo.sap.com/gen/default/public/WatermarkCompilation/lib/java/demo.sap.comexternallibrarypdftoolsforwatermarking~WatermarkCompilation.jar"/>
    I have also added the jar files I used in my external library project as "User Library" from Java Build Path . I dont do it , then the code fails during compilation itself.
    Regards,
    Shiv

Maybe you are looking for

  • Ship to party and vendor relation in third party process

    Hello Experts, I need your precious suggestions on my business requirement. When we create the third party sales order system creates the Purchase Requisition and further PO is created through purchasing department. Suppose in my third party sales or

  • Premiere Pro CS4 "Export Settings" window does not show up.

    Hello, I've run into a new problem with Premiere Pro CS4. Basically, when I select "File > Export > Media" my Export Settings window doesn't show up. If I click on the Premiere window I hear the beeping sound and nothing happens, if I hit Enter the E

  • Problem in clones. Saving to disk and transmiting to the web

    Hello, Well, i have a problem with clones, i'm saving audio/video to disk, and at the same time i'm seeing the video in a player for that i used the merge function available in the JMF Solutions. My main problem is when i try to transmit to the web,

  • Clamav running even though virus filtering is disabled

    greetings all, I am running an OS X Server 10.4.8 machine. I have virus filtering turned off, and with good reason - when it is on, there is a big performance hit. However, this afternoon clamav randomly clicked on, even though virus filtering is sti

  • Variant Input Parameters with ActiveX Objects

    I've created an ActiveX library that exports a variety of objects using Visual C++ Version 6.0. I'm testing the methods and properties of these objects using both LabVIEW and Visual Basic clients. The problem I'm facing is that when testing under Lab