Search Results

Search found 251 results on 11 pages for 'jscript'.

Page 1/11 | 1 2 3 4 5 6 7 8 9 10 11  | Next Page >

  • Reference methods defined in one JScript file from another JScript

    - by Thomas Svensen
    I am writing some server-side scripts using jscript and WSH. The scripts are getting quite long, and some common functions and variables would fit better in a general library script which I included in my various script instances. But, I cannot find a way reference one JScript file from another. For a moment, I though reading the file contents and passing it to "eval()" could work. But, as it says on MSDN: "Note that new variables or types defined in the eval statement are not visible to the enclosing program." (http://msdn.microsoft.com/en-us/library/b51a45x6.aspx) Is there any way to include/refence a JScript from another one?

    Read the article

  • Memory leak with Microsoft.JScript.Eval.JScriptEvaluate?

    - by Dmi
    I'm evaluating some javascript with Microsoft.JScript.Eval.JScriptEvaluate() and I noticed from my memory profiler that there are a large number of System.String left allocated by Microsoft.JScript.HashtableEntry. Microsoft.JScript.Eval is a static class, does anyone know what class is holding these instances and how I can clear them?

    Read the article

  • Cast to delegate type fails in JScript.NET

    - by dnewcome
    I am trying to do async IO using BeginRead() in JScript.NET, but I can't get the callback function to work correctly. Here is the code: function readFileAsync() { var fs : FileStream = new FileStream( 'test.txt', FileMode.Open, FileAccess.Read ); var result : IAsyncResult = fs.BeginRead( new byte[8], 0, 8, readFileCallback ), fs ); Thread.Sleep( Timeout.Infinite ); } var readFileCallback = function( result : IAsyncResult ) : void { print( 'ListenerCallback():' ); } The exception is a cast failure: Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'Microsoft.JScript.Closure' to type 'System.AsyncCallback'. at JScript 0.readFileAsync(Object this, VsaEngine vsa Engine) at JScript 0.Global Code() at JScript Main.Main(String[] ) I have tried doing an explicit cast both to AsyncCallback and to the base MulticastDelegate and Delegate types to no avail. Delegates are supposed to be created automatically, obviating the need for creating a new AsyncCallback explicitly, eg: BeginRead( ... new AsyncDelegate( readFileCallback), object ); And in fact if you try to create the delegate explicitly the compiler issues an error. I must be missing something here.

    Read the article

  • Microsoft premier éditeur à publier ses spécifications JavaScript~ JScript 5.7 et 5.8, ses implément

    Microsoft premier éditeur à publier ses spécifications JavaScript JScript 5.7 et 5.8, les implémentations de JavaScript pour Internet Explorer 7 et 8 Microsoft vient de publier les spécifications de JScript : JScript 5.7 pour Internet Explorer 7 et JScript 5.8 pour Internet Explorer 8. Pour mémoire JScript est l'implémentation maison de JavaScript utilisé par Redmond dans ses navigateurs. JavaScript suit les standards de la spécification ECMA-262 (ou ECMAScript) dont le but est d'uniformiser, autant que faire se peut, le cadre de travail des développeurs web. D'où le nom des deux documents récemment publiés sur MSDN : "Internet Explorer ECMA-262 ECMAScript Language ...

    Read the article

  • How do you set up your JScript (NOT JScript.NET) development environment?

    - by jJack
    In my environment, if I create a class in JScript syntax: class test{ } and then save it to a file named "test.js" and run it with wscript, I get a Microsoft JScript "Syntax error" at line 1. However, if I simply, say, write a function: function getInput() { var wshell = WScript.CreateObject("WScript.Shell"); wshell.Popup ("Do you want to continue?"); return userInput } getInput() and run it the same way, it works. Hopefully, there is something fundamentally wrong with my class definition. If that is the case, I am excited to find out.

    Read the article

  • A jscript variable in a Query

    - by lerac
    Maybe a very simple question. How can I put in this code <Query> <Where> <Eq> <FieldRef Name="Judge_x0020_1" /> <Value Type="Text">mr. R. Sanches</Value> </Eq> </Where> </script> </Query> A variable from jscript in the area of the code where mr. R. Sanches is written. So my jScript contains a dynamic text variable I want to replace mr. R. Sanches with. See where it says THE JAVESCRIPT VAR underneath here: <Query> <Where> <Eq> <FieldRef Name="Judge_x0020_1" /> <Value Type="Text">THE JAVASCRIPT VAR</Value> </Eq> </Where> </script> </Query>

    Read the article

  • Looks like COM object is created, but JScript fails to get a reference

    - by damix911
    I'm using the following code to create a COM component that I have developed and registered. var mycom = new ActiveXObject("Mirabilis.ComponentServices.1"); mycom.SetFirstNumber(5); mycom.SetSecondNumber(3); The first line runs fine, while if I alter the ProgID (that is, the string passed to ActiveXObject) I get the message Automation server can't create object. This suggests that at least the basics of the registration mechanism are working properly. I integrated some logging calls into the DLL. When I run the script I get the proof into the log file that both this call to QueryInterface: STDAPI DllGetClassObject( const CLSID &clsid, const IID &iid, void **ppv) { ... CAddFactory *pAddFact = new CAddFactory; ... HRESULT hr = pAddFact->QueryInterface(iid, ppv); if (hr == S_OK) writeToLogFile("Class QueryInterface returned S_OK"); else writeToLogFile("Class QueryInterface failed"); return hr; ... } and this one: HRESULT __stdcall CAddFactory::CreateInstance( IUnknown *pUnknownOuter, const IID &iid, void **ppv) { ... CAddObj *pObject = new CAddObj; ... HRESULT hr = pObject->QueryInterface(iid, ppv); if (hr == S_OK) writeToLogFile("Object QueryInterface returned S_OK"); else writeToLogFile("Object QueryInterface failed"); return hr; ... } return S_OK. However, when JScript gets to line 3 of the script, I get the following error message: 'mycom' is null or not an object Why is this happening? It looks like JScript should be able to obtain a reference. Some attempts I made I tried to return S_FALSE from DllCanUnloadNow to be sure that the DLL will not be unloaded, just in case, but with no luck.

    Read the article

  • MVC 2 JScript Runtime Error: FormContext is null

    - by Kenny
    When loading a page in my MVC project, I am getting a JScript runtime error that origininates in the MicrosoftMvcValidation.js file saying that Sys.Mvc.FormContext is null or not an object. The page includes a standard "Add" form and a partial view that shows a list of data items. I have the references to the js files in the master page as follows. What could be causing this and how might I be able to fix it?

    Read the article

  • setTimeout not working in windows script (jscript)

    - by Sibo Lin
    When I try to run the following code in my program setTimeout("alert('moo')", 1000); I get the following error Error: Object expected Code: 800A138F Source: Microsoft JScript runtime error Why? Am I calling the wrong function? What I want to do is delay the execution of the subsequent function.

    Read the article

  • Instantiating a System.Threading.Thread object in Jscript

    - by user297029
    I'm trying to create a new System.Threading.Thread object using Jscript, but I can't get the constructor to work. If I just do the following, var thread = new Thread( threadFunc ); function threadFunc() { // do stuff } then I get error JS1184: More than one constructor matches this argument list. However, if I try to coerce threadFunc to System.Threading.ThreadStart via var thread = new Thread( ThreadStart(threadFunc) ) I get error JS1208: The specified conversion or coercion is not possible Anyone know how to do this? It seems like it should be trivial.

    Read the article

  • how to stop the showing error message in visual studio for jscript in visual studio 2010

    - by steven spielberg
    i am using IE 8 for testing the javascript i write for my web-application. i use something who are not unknown for IE 8 so they give me error each time "Microsoft JScript runtime error: Object doesn't support this property or method". are their any way to stop this error showing in visual studio when i debug the javascript. when i refresh the page they give me error in visual studio. well i not want to see anything like showing error in visual studio. so how i can disable the showing error for javascript in visual studio even i need to work with javascript breakpoint and trackpoint.

    Read the article

  • Quicker searching in JScript using the Bash

    - by gentlesea
    I am using the following JScript code to search for a string inside a file: var myFile = aqFile.OpenTextFile(fileToSearchIn, aqFile.faRead, aqFile.ctANSI); while(!myFile.IsEndOfFile()) { s = myFile.ReadLine(); if (aqString.Find(s, searchString) != -1) Log.Checkpoint(searchString + " found.", s); } myFile.Close(); This is rather slow. I was thinking about using bash commands in order to speed up the search in file process: var WshShell = new ActiveXObject("WScript.Shell"); var oExec = WshShell.Exec("C:\\cygwin\\bin\\bash.exe -c 'cat \"" + folderName + "/" + fileName + "\"'"); while (!oExec.StdOut.AtEndOfStream) Log.Checkpoint(oExec.StdOut.ReadLine()); while (!oExec.StdErr.AtEndOfStream) Log.Error(oExec.StdErr.ReadLine()); Since every time bash.exe is started a new window opens the searching is not faster than before. Is there a possibility to have the bash run in the background using another switch?

    Read the article

  • Reading a Windows 'binary' float into a ASP jscript variable

    - by user89691
    I need to read files produced by a legacy Windows app that stores real numbers (the 8-byte "double" type) in binary - i.e. as a packed array of 8 bytes. I can read the 8 byte group OK but how can I present it to my ASP JScript code such I can get the real number back again. Or to put it another way: Say a file was produced by a Windows (Delphi) program: Assign (f, 'test.bin') ; rewrite (f, 1) ; r := 1234.56E78 ; BlockWrite (f, r, SizeOf (Double)) ; Close (f) ; Inspection of the file will show it contains 8 bytes, being: 94 0E 4C CA C2 97 AD 53 which is the real number in IEEE format. Assuming I can read these 8 bytes back in ASP, is there a simple way of getting the real number back again?

    Read the article

  • jQuery "Microsoft JScript runtime error: Object expected"

    - by Oskar Kjellin
    I have the below code that does not seem to work at all :( I keep getting: Microsoft JScript runtime error: Object expected The error seems to occur when the timeout is done. So if I raise the timeout with 10 seconds the error holds for another 10 seconds. I want to be able to update the number of friends online async. The number is shown with the following html: <a href="" id="showChat" >Friends online <strong id="friendsOnline">(?)</strong></a> The friends part is set at the first run, but when the timeout calls back it does not fire again. Also, I cannot see on which line the error occurs because if I want to break on the error it just shows "no source code" etc. The code below is the code I'm using. Thanks! <script src="http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.js" type="text/javascript"></script> <script src='/Scripts/MicrosoftAjax.js' type="text/javascript"></script> <script src='/Scripts/MicrosoftMvcAjax.js' type="text/javascript"></script> <script src='/Scripts/jquery.autocomplete.js' type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { UpdateFriendsOnline(); function UpdateFriendsOnline() { window.setTimeout("UpdateFriendsOnline()", 1000); $.get("/Account/GetFriendsOnline", function(data) { $("#friendsOnline").html("(" + data + ")"); }); } }); </script>

    Read the article

  • JScript.NET private variables

    - by Paul Podlipensky
    I'm wondering about JScript.NET private variables. Please take a look on the following code: import System; import System.Windows.Forms; import System.Drawing; var jsPDF = function(){ var state = 0; var beginPage = function(){ state = 2; out('beginPage'); } var out = function(text){ if(state == 2){ var st = 3; } MessageBox.Show(text + ' ' + state); } var addHeader = function(){ out('header'); } return { endDocument: function(){ state = 1; addHeader(); out('endDocument'); }, beginDocument: function(){ beginPage(); } } } var j = new jsPDF(); j.beginDocument(); j.endDocument(); Output: beginPage 2 header 2 endDocument 2 if I run the same script in any browser, the output is: beginPage 2 header 1 endDocument 1 Why it is so?? Thanks, Paul.

    Read the article

  • Pass client side js variable into server side jscript

    - by George
    How can I get the query string from the browser url using client side js and set it as a variable to use in some server side scripting? Client side script: var project = getQueryString("P"); function getQueryString(param) { var queryString = window.location.search.substring(1); splitQueryString = queryString.split("&"); for (i=0; i<splitQueryString.length; i++) { query = splitQueryString[i].split("="); if (query[i] == param) { return query[1]; } } } Server side script: response.write ('<td><a href="/index.asp?P=' + project + ">' + obj.BODY[i].NAME + '</a></td>');

    Read the article

  • [jscript] Good (better) substition for setInterval or setTimeout

    - by riffnl
    I've got a masterpage with some nice UI (jQuery) features. One of these options is interefering with my embedded YouTube (or other alike-) objects. On each, in this case, setInterval event the embedded video stops displaying new frames (for like a second). More detail: I've got a "polaroid" gallery (in the header) with only 5 100x100 images in it (test: preloading has no effect on performance) and my gallery will show or hide them (fade-in / fade-out) after a period of time. (test: non-animated display:hide or display:block has no effect on performance). After some testing and I've come to the conclusion that it isn't the "animated" showing or hiding of the pictures, but it's the interval itself (- since altering to display:hide or block had the same result). Perhaps it is my "gallery" "function" on itself ... function poladroid() { if (!galleryHasFocus) { if (galleryMax >= 0) { galleryCurrent++; if (galleryCurrent > galleryMax) { galleryCurrent = 0; showPictures = !showPictures; } if (showPictures) { $('#pic-' + galleryCurrent.toString()).show("slow"); } else { $('#pic-' + galleryCurrent.toString()).hide("slow"); } } } if (!intervalSet) { window.setInterval("poladroid()", 3000); intervalSet = true; } } It's not like my function is doing really awkward stuff is it? So, I was thinking I needed a more "loose" interval function.. but is there an option for it?

    Read the article

  • JScript JSON Object Check

    - by George
    I'm trying to check if json[0]['DATA']['name'][0]['DATA']['first_0'] exists or not when in some instances json[0]['DATA']['name'] contains nothing. I can check json[0]['DATA']['name'] using if (json[0]['DATA']['name'] == '') { // DOES NOT EXIST } however if (json[0]['DATA']['name'][0]['DATA']['first_0'] == '' || json[0]['DATA']['name'][0]['DATA']['first_0'] == 'undefined') { // DOES NOT EXIST } returns json[0]['DATA']['name'][0]['DATA'] is null or not an object. I understand this is because the array 'name' doesn't contain anything in this case, but in other cases first_0 does exist and json[0]['DATA']['name'] does return a value. Is there a way that I can check json[0]['DATA']['name'][0]['DATA']['first_0'] directly without having to do the following? if (json[0]['DATA']['name'] == '') { if (json[0]['DATA']['name'][0]['DATA']['first_0'] != 'undefined') { // OBJECT EXISTS } }

    Read the article

  • How do I add the following jscript and css code to my page

    - by rosted
    Hi every one, I'm a bit new to joomla and i'm, I'm trying to add the following function to my joomla site script Lights Out – Dimming/Covering Background Content with jQuery this function can be found on the following link http://buildinternet.com/2009/08/lights-out-dimmingcovering-background-content-with-jquery/ I have tried to include the code both the css and the java but i'm not able to add it on my article can any one please help Thanks

    Read the article

  • Microsoft JScript runtime error: ASPx is undefined

    - by Joe
    I'm getting this error all over the place in my web application and trying to figure out why. The error is always for some control, ASPxClientTextBox for example. So far the only thing I've found as a potential fix is to check the httphandlers section of the .net web.config (the one in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config) and make sure an entry for "WebResource.axd" exists, which it does. Any idea's what's going on or where I should look?

    Read the article

  • Microsoft JScript runtime error in Visual studio 2010

    - by anirudha
    There is many tool exist to debug JavaScript visual studio , firebug and some other great plugin are one of them. here I show you solution for Microsoft JScript runtime error: Object doesn't support this property or method  if you search on Google for how to debug Javascript in Visual studio. all of them told you to follow this instruction :- go to Internet option in IE > advanced tab > Browsing section > uhcheck the both option disable script debugging for IE (internet explorer) disable script debugging (others). that’s the information you read are outdate or not true these days. in visual studio you can play with JavaScript debugging even these option is check or unchecked. off-course you  can try these step in express version of visual studio. I found a little problem that my code [based on jQuery plugin] try to call some function. some of them not implement in browser so they call other so that’s fine and work in every browser. when visual studio found some function they trying to call and not implemented in browser I use to debug they tell me Microsoft JScript runtime error: Object doesn't support this property or method  they tell me again whenever I put refresh [f5] in browser. so the thing they do you never like that. see error window first whenever code is not buggy and see everytime before see the page you want to see. this behavior harsh you. there is no problem whenever you not commonly used IE but whenever you really want to debugging you got some pain too from the behavior of this. well I have some patch for that if you really like the debugging in Visual studio with IE. so if you sure that code is not buggy or you really not want to see that’s window here is trick. when you debug the JavaScript in IE choose the compact mode and they never force you to see window first who tell the thing you not want to see. How to do that for reliefs from this pain in visual studio after debug the project or website IE gone automatically launch. go to Developer tool by pressing f12 > you see window something like this:- by the way they give you document mode IE 7 as default or browser mode based on your settings. first thing is that you need to set the compact view [any ] in browser mode. and next time the error window never come again who tell you Microsoft JScript runtime error: Object doesn't support this property or method

    Read the article

1 2 3 4 5 6 7 8 9 10 11  | Next Page >