Call a javascript function (in ASPX) page from a javascript file

I have a javascript file (viewer.js) situated in Scripts/viewer.js My
default.aspx has a javascript functions that calls a c# function in the
default.aspx.cs ( it sends a http webrequest)
Now I want to call from the viewer.js the function in default.aspx which calls the c# function.
How can I handle this in my viewer.js?
I need to do this because I work with 3D objects and the select event is on the viewer.js
When I select the 3D object it needs to call the function in default.aspx...
Scripts/viewer.js
function ClickPickItem(item) {
$("#properties").show();
/*Call function App() */
Default.aspx
function App() {
PageMethods.Connect(callback);
Default.aspx.cs
[WebMethod]
public static string Connect()
string rsp = DigestAuthFixer.GrabResponse("http://<username>:<password>@nextbus.mxdata.co.uk/nextbuses/1.0/1");
... CODE TO MAKE HTTPWEBREQUEST}
Sorry if I'm not clear enough
I don't see another option like this
What I need to do?
Thanks!

If my understanding is not wrong, you are trying to call a Javascript function in a separate script block from a linked Javascript page. rite?
When it comes to Javascript, all scripts will be posted to the client side browser and we can access any method between pages provided those JS files are linked to the page.
So you can directly call
App()
function from your
ClickPickItem()
function.
Please try and let us know your result.

Similar Messages

  • Having trouble loading ASPX pages from one website, only in firefox, only on one computer.

    I am having an issue where firefox will not load an aspx page, from one computer. It seems to work fine on everything else. I have disabled the virus scanner, firewall and web filter. It works fine on other browsers, on the same computer.
    I've tried clearing the cookies, cache and offline storage. I also uninstalled and reinstalled firefox and tried loading the page in firefox safe mode.
    Any ideas?
    [http://blog.acadianacomputerrepair.info/portals/blog/images/firefoxwontloadaspx/firefoxbrowser.jpg Firefox ScreenShot]

    Do you have that problem when running in the Firefox SafeMode? <br />
    [http://support.mozilla.com/en-US/kb/Safe+Mode] <br />
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this: <br />
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • We encountered a problem with some client machines that use Firefox version 24ESR and IE8. Ajax requests of aspx pages from Firefox are getting the following er

    I encountered a problem with some client machines that use Firefox version 24ESR and IE8.
    Ajax requests of aspx pages from Firefox are getting the following error from the iis server (iis version 7.5):
    Bad Request - Request Too Long
    HTTP Error 400. The size of the request headers is too long.
    From analyzing the request that was sent to the server, I saw that the request consist of only the viewstate of the aspx page.
    I tried to disable the viewstate for one page and the server got the request correctly.
    I do not encounter any issues on these laptops with postback requests from Firefox or when running the same application with IE8.

    Sometimes that means that the page address sent is loo long.
    Check the link address you are using.
    I can't help you further and will send for more help.

  • 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

  • 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

  • I am trying to delete pages from a PDF file. I opened the bookmarks, selected the pages to delete and choose Edit Delete. The selected pages are not deleted. Note: I have to open the file using a passport provided by an external party.

    I am trying to delete pages from a PDF file. I opened the bookmarks in the PDF file, selected the pages to delete and choose Edit > Delete. The selected pages are not deleted. Note: I have to open the file using a passport provided by an external party.

    Resolved

  • Move group of pages from one InDesign file to another InDesign File using VB.Script

    Dear team,
    I am trying to move group of InDesign pages from one indesign file to another indesign file using vb.script.
    I have written the code like
    Dim Pages=IndDoc.Pages
    Dim Mytype=TypeName(Pages)
    Pages.Move(InDesign.idLocationOptions.idBefore,IndDoc1.Pages.LastItem)
    but it is giving an error as method Move is not a member of Pages 
    please give mme the solution to move the Multiple pages or a group of page from one Indd to another Indd.

    Hey Peter, if I wan to move several page that part of Auto Flow text, I checked the "delete page after moving" but the content still there, not deleted.
    Is there any way to delete it automatically, just to make sure I have moved that autoflowed page?

  • Which Version of Adobe do I need to be able to "extract" a page from a existing  file and save/download to another file?

    Which Version of Adobe do I need to be able to "extract" a page from a existing  file and save/download to another file?

    Acrobat Pro or Standard.

  • Saving One or Two pages from a PDF file

    How do I save one or two pages from a PDF file that have been emailed to me? 

    Hi molalla98,
    The task that you are trying to perform is not possible via Adobe Reader, You would require Adobe Acrobat to extract the pages from Multi-Page PDF and save it accordingly.
    ~Pranav

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

  • Using forms button to insert a page from an attachment file?

    Could somebody point me in the right direction so that I can understand how to approach the following task?
    I want to create a form that has a button that a user can press if a particular condition is met.
    For example if it is raining outside the user will press button "A" and a specific page, taken from an attached file, containing a picture of an umbrella will be inserted after the current page.
    If it is sunny outside then the user will press button "B" and a different page, taken from the same attached file, containing a picture of a beach will be inserted after the current page.
    I think I know that I need to use a JavaScript application level function.
    Is there an easier way of achieving the same result?

    Hi Jari,
    Thanks for your response - apologies for now replying sooner.
    I decided to remove the pages in the application builder and then implement the changes using an application export as suggested - went smoothly.  I used the Advisor to check the application which highlighted some additional redundancy that I needed to take care of resulting from removing the pages.
    Thanks
    Karl

  • How do I print 2 pages from a pdf file and enlarge it

    how do i print 2 pages from a file and enlarge it  to email

    Hi stevebulldog,
    Do I understand correctly that you'd like to extract two pages from a PDF, and then send them via email?
    To extract pages from a PDF, you need to use Acrobat. If you don't have Acrobat, you can try it for free for 30 days. Please see http://www.adobe.com/products/acrobat.html.
    I'm not sure what you mean by "enlarge" it. When your recipient views the PDF, they can enlarge the view (zoom in on the PDF) by choosing options from the View menu in Acrobat or Reader.
    Best,
    Sara

  • How do I convert a selected nomber of pages from a pdf file?

    How do I convert only selected pages of a pdf file?

    One way would be to open the PDF with Acrobat XI Pro. Then from Tools - Pages use the feature that supports page extractions to a new PDF.
    Use this new PDF as the "source" PDF for Acrobat's File - Save As Other to export to a supported file format.
    Be well...

  • How can I delete pages from a pdf file

    How can I delete pages from a pdf file

    Hi timk,
    None of the Acrobat.com online services allow you to edit a PDF file. But, in checking your account, I see that you purchased an Acrobat Standard subscription, and you can certainly use that to edit a PDF file.
    Have you downloaded and installed Acrobat Standard? It sounds to me as though you may be opening the PDF file in Adobe Reader, rather than Acrobat. (Reader doesn't allow you to edit PDF files.)
    If you haven't already, download and install Acrobat from https://cloud.acrobat.com/acrobat. Then, make sure that you're opening your PDF files in that rather than Reader, when you want to edit them.
    Please let us know how it goes!
    Best,
    Sara

  • How can I save one specific page from a .pdf file into it's own .pdf file?

    I've got this 4 page pdf file, and I need to save just one page from it.  I know that there's the option of using the select tool and doing a copy/paste to an image file, but I'm trying to keep it as a .pdf and I can't seem to figure it out.  Any help would be much appreciated.

    Perhaps this solutions workability will depend a lot on what type and generation of PDF you got and the tech built into the program suggested....
    But ! (never-the-less)
    You could try to see if the "Free PDF to Word Doc Converter version 1.1" will work for you....
    I know it will not get you a single page .PDF but if the program works you could get a .Doc of which you might have the possibility to save a single page after editing it !(?)

Maybe you are looking for

  • Can't send email through my aol mail on my iPad 2 after updating to iOS 7

    I had to update m iPad because I was no longer able to work a lot of my apps because they kept telling me that there was an update that I had to do in order to even work my apps!  I was very reluctant to do it in the first place fearing that I would

  • Materials Management and Production Planning

    Hello All, I've been searching for good reference materials on SAP R/3 PP and MM modules for a while now. Majority of available literature out there relates to implementation strategies and does not teach actual functionality and configuration of MM

  • Pros/Cons of replicating to files versus staging tables

    I am new to GoldenGate and am trying to figure out pros/cons of replicating to flatfiles to be processed by an ETL tool versus replicating directly to staging tables. We are using GoldenGate to source data from multiple transaction systems to flatfil

  • How do i force empty the trash with old backups in it?

    I am clearing out some old backups created by the TimeMachine and am unable to empty them from the Trash or return them. How can I force the Trash to empty?

  • Address book jumping to first contact

    Alright. Here's my problem. Whenever I get to a specific contact in the middle of the Address book the address book will change the highlighted contact to the very first contact. This means whenever I try to select and edit or view (as an example) Mi