w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Getting 404 error while jquery.TypeScript.DefinitelyTyped
You can download it manually from here https://github.com/borisyankov/DefinitelyTyped To be more exact this is the file : https://github.com/borisyankov/DefinitelyTyped/tree/master/jquery

Categories : Typescript

DefinitelyTyped d.ts files and Amd Modules with TypeScript
Some of the definitions do have this section e.g. Underscore. The reason why many of them don't is because the name of the import depends upon how you configure requirejs and the short path name you choose in your configuration.

Categories : Typescript

webstorm typescript display compile error
Based on Meta Discussion Update (25/8/2013) This issue has been fixed in typescript 0.9.1 Update (7/8/2013) Looks like this issue is already on the radar, please vote for it to make it a BIG blip.

Categories : Typescript

webstorm: typescript bool vs. boolean
Webstorm language service currently only works with 0.8.x, The typescript language service inside WebStrom does not understand the changes made in 0.9.x, and since the TypeScript language service api changed (for the better imho) from 0.8 to 0.9 its not a drop in replacement. A new version of WebStorm with these features is on the way though (should be soon).

Categories : Javascript

Webstorm: how to exclude javascript from code completion in typescript project
Right click on the folder that contains your compiled javascript and select "Mark Directory As" then "Excluded". WebStorm will hide the directory from the project view, stop indexing it for searches and code completion, and not include it in code refactoring tracing. I tend to mark all build output as ignored and ensure that WebStorm is only worrying itself with the source.

Categories : Typescript

webstorm + typescript "unresolved variable" after adding reference path
Modify it to "export interface IBaseClass" and on the other side you need to require it. At runtime you might get an error loading a js file not there. If so make an empty js file. My recommendation : do not have a file just with interfaces when using requirejs/commonjs

Categories : Typescript

Error message in typescript saying that function parameters don't match @TypeScript 0.9.1
When you want to use the lexically escaped value of this (which refers to the class) as well we as the context value of this (e.g the this inside a jquery callback which refers to the element that raised the event etc). You cannot use fat arrow / lambdas ()=>{}. You use function, and store this for the class variable yourself. However in your code I see that you only want to use this which refers to the class so a lambda ()=>{} is sufficient for your case. Your code compiles fine: Check it online.

Categories : Javascript

highlight words on page just like jQuery.highlight()?
If you know what words need to be highlighted, just make a css class higlight and use as follows:<span class='highlight'>My highlighted text</span>. As for the css, use for example .highlight{ background-color: yellow; } You can also use str_replace to replace certain words, like so: str_replace( $word, '<span class="highlight">'.$word.'</span>', $mytext) $mytext would obviously be the the whole text, and $word the word you wish to highlight. You could make an array of words that need to be highlighted and just do a foreach().

Categories : PHP

TypeScript with require.js and jquery does not work on production server (require.js Script Error)
Are you compiling your website in Release mode when you are deploying to your server? In that case you need to add a release version in the project file: <PropertyGroup Condition="'$(Configuration)' == 'Release'"> <TypeScriptSourceMap> --module AMD</TypeScriptSourceMap> </PropertyGroup> <Target Name="BeforeBuild"> <Message Text="Compiling TypeScript files" /> <Message Text="Executing tsc$(TypeScriptSourceMap) @(TypeScriptCompile ->'&quot;%(fullpath)&quot;', ' ')" /> <Exec Command="tsc$(TypeScriptSourceMap) @(TypeScriptCompile ->'&quot;%(fullpath)&quot;', ' ')" /> </Target> In TypeScript 0.8.2+ the format is: <PropertyGroup Condition="'$(Configuration)' == 'Debug'"> <TypeScr

Categories : Jquery

jQuery highlight malfunctioning with jquery 1.8.2 and jquery custom 1.8.24
Check this http://jsfiddle.net/6mMNX/ $(document).ready(function () { $("#comment" + 33).click(function () { $(this).effect("highlight", {}, 2000); }); }); Your code works. Check for dependencies if all your libraries are added correctly.

Categories : Javascript

Add a TypeScript file to a non-TypeScript project in Visual Studio 2012?
My experience has been that I can add .ts files and .d.ts files to web c# projects and they compile. I have not found 'add typescript' file on the add context menu but I have found you can add a text file .ts or .d.ts and it is recognised. You may have to amend the compile action to 'TypescriptCompile'. Apart from that and some debugging funnies I have found TypeScript to be one of the cleverest things around...awesome in fact

Categories : Typescript

Use jquery.handsontable in typescript
The TypeScript compiler doesn't like your empty object. It has no information about its type or the properties that may exist on it. The easiest would be per this question: var cellProperties:any = {}

Categories : Javascript

jQuery UI widgets in TypeScript
You also need to include jquery.d.ts in order to access and manipulate typed jQuery objects. This will allow you to access your slider in the typical jQuery way. For example: /* Initialize slider with ID 'my_slider'. */ $("#my_slider").slider({ min: 0, max: 100, value: 0, change: (event: Event, ui) => { /* Update as desired. */ } }); In this example, the type for $('#my_slider') is defined in jquery.d.ts, and all the relevant slider functions and such are defined in jqueryui.d.ts. Just to finish off the example, in your HTML, you'll want something like: <div id="my_slider"></div> EDIT: I think this is a bug. Even with the following: var my_slider : JQueryUI.Slider = $('#my_slider').slider; my_slider.slide({ ... }) It still doesn't

Categories : Jquery

TypeScript JQuery UI Typed
I think this is due to PHPStorm using version 0.8 rather than 0.9 - so for example it expects bool where boolean is actually the type name now. If you look back through the version history on Definitely Typed you should be able to grab an older version with bool types while you wait for an update from JetBrains.

Categories : Jquery

D3, Typescript, and GraphNodes (Optional fields in a typescript interface)
All of them are not required but perhaps some are and the interface definition does not reflect that as of yet. Perhaps you can mark which ones are optional for community support. In any case. When you want to enforce strict behavior on others but want the flexibility to break out your self you can use any. e.g. : var data:GraphData = <any>{ "nodes": [{ "group": 0, "id": 0 }, { "group": 0, "id": 1 }, { "group": 0, "id": 2 }], "links": [{ "source": 0, "target": 2, "value": 1 }, { "source": 0, "target": 0, "value": 1 }, { "source": 2, "target": 1, "value": 1 }, { "source": 2, "target": 1, "value": 1 }] }

Categories : Javascript

Typescript this being overriden by jquery hover
If you want to use the this provided from the callback as well as the this of the class instance, you'll need to do that manually, e.g.: constructor() { // ... var self = this; this.HoverElement.hover(function(event) { self.HandleHover(event, this); }); } HandleHover(event: JQueryEventObject, jqueryThis: JQuery) { $(jqueryThis).attr(/*etc*/); this.OtherFunction(); }

Categories : Javascript

JQuery definition screwed up with TypeScript 0.9
This is not a bug. Its a planned feature. This is because once you have an indexer defined, it can be used to access properties as well and therefore properties need to be subtypes of the indexer. e.g.: interface Foo{ [x:string]:number; // Now all properties must be subtypes of number bar:number ; // okay baz:string ; // Error } Try It You can find working Jquery definitions here : https://github.com/borisyankov/DefinitelyTyped/blob/master/jquery/jquery.d.ts

Categories : Typescript

Is there a JQuery UI layout interface for Typescript?
Definitely Typed is the largest source for type definitions. And they do indeed have a definition for jQuery UI. And they will soon have a definition for jQuery UI Layout - although it is a basic version right now as I'm not familiar with the implementation.

Categories : Javascript

Not updating CSS effect when jQuery in TypeScript
You have a minor typo: $("el").css({"color": "red" }); Should be $(el).css({"color": "red" }); Using "el" will select elements of type <el>, whereas passing the variable el will wrap the element in a jQuery object. You could use: var myHtml = Show({ name: "Delphian", url: "stackoverflow.com/users/602714/delphian" }); $('#content').css({"color": "red" }).html(myHtml); Plain JavaScript demo on JSFiddle - but should work just the same in TypeScript too.

Categories : Jquery

TypeScript error Web essential
File encoding was an issue with TS 0.9.0 Fixed in the latest version. You can download 0.9.1 from here : https://typescript.codeplex.com/releases/view/102929 PS: I recommend uninstalling WebEssentials before installing 0.9.1 as they tend to conflict (webessentials starts to leak memory). TS 0.9.1 has pretty awesome and stable support for Visual Studio 2012

Categories : Visual Studio 2012

Typescript lambda error
When you do lambdas like that in Typescript, you leave off the function keyword. Perhaps your tutorial has an error. edit — from the spec: TypeScript supports arrow function expressions, a new feature planned for ECMAScript 6. Arrow function expressions are a compact form of function expressions that omit the function keyword and have lexical scoping of this.

Categories : Javascript

how to import jQuery plugin into Typescript file?
After you have added the following line : /// <reference path="jquery.d.ts"/> You need to tell TypeScript about the functions added by SlofSlider (not sure about the name?) e.g. if you want : $('div').slider(); to compile you would do something like: interface JQuery { slider: Function; }

Categories : Jquery

The jquery.d.ts definition is generating many errors in TypeScript 0.9
The TypeScript definition you have won't work in the TypeScript 0.9 compiler. You can get the latest version from either... Codeplex or Definitely Typed You'll notice that the indexers are updated from: headers?: { [key: any]: any; }; To headers?: { [key: string]: any; }; This is to comply with tighter compiler rules that state the key must be a string or a number.

Categories : Jquery

JQuery API Doc generator for typescript custom Widget?
So far I think there is no official support for any documentation lib integrated into typescript. Typescript supports jsdoc. This means you should use jsdoc style documentation for your typescripts. I think the compiler should also have an option to add your ts comments into the js files. This should enable you to at least document your javascript API, which is more or less what others might need/use to integrate your APIs anyways.

Categories : Javascript

jQuery highlight table row except top one
Try this - $('table tr:not(:first)').mouseover(function() { $(this).addClass('hovered'); }).mouseout(function() { $(this).removeClass('hovered'); }); Or you can use gt $('table tr:gt(0)')

Categories : Jquery

Jquery sliding highlight
You can use the methods explained here to accomplish what you are looking for. Set a background: linear-gradient(to right, yellow 50%, white 50%); and then use background-position: left bottom; or background-position: right bottom; combined with transition:all 3s ease; to get the left-to-right effect. Here is a JSFiddle derived from gar_onn's answer (link on the first line): http://jsfiddle.net/23zea/ Hope this was what you were looking for.

Categories : Jquery

Typescript Error Message error TS2173: Generic type references must include all type arguments
That line should have been: promise(type?: any, target?: any): JQueryPromise<any>; I'll send them a pull request. Thanks. JQueryPromise is a generic interface. i.e. it takes type parameters. Starting with TS 0.9.1.1 they are more strict about generic parameters. They must be specified from now on. This was allowed in previous versions (where the type was assumed to any implicitly) but the compiler analysis is stricter now (and the type must be specified explicitly).

Categories : Typescript

TypeScript: tsc.exe --execute: Error cannot find module
Your code is fine. The -e flag is being removed from tsc, partly because it doesn't play nicely with this sort of scenario. Executing arbitrary JS in the context of the compiler process turns out to not be a good idea.

Categories : Node Js

Internal module in TypeScript: undefined error
I think your problem is most likely that module.js isn't actually getting loaded. Most browsers include some debugging tool to look at the web traffic, but I prefer Fiddler. It's browser independent and really powerful. Since you're using internal modules (a choice we also went with) you might want to consider compiling your source to a single file. It cuts down on network traffic, keeps your filesystem neat and your HTML file simpler. To do that open up the csproj file in a text editor, look for the PropertyGroups that include <TypeScriptTarget> and add <TypeScriptOutFile>outputfile.js</TypeScriptOutFile> where outputfile.js is the name of the file you want generated. Here's mine as an example: <PropertyGroup Condition="'$(Configuration)' == 'Debug'">

Categories : Typescript

How to highlight a particular date in jquery ui datepicker
Try with $(function() { $("#datepicker").datepicker({ beforeShowDay: function(d) { var a = new Date(2012, 3, 10); // April 10, 2012 var b = new Date(2012, 3, 20); // April 20, 2012 return [true, a <= d && d <= b ? "my-class" : ""]; } }); }); here is an example: http://jsfiddle.net/qaEuj/ See this answer: Highlight dates in jquery UI datepicker

Categories : Javascript

jquery highlight image by click
var id = $(this).attr("id"); or var id = $(this).prop("id"); then use it like this $("#" + id).val(.... for storing data you can use cookie localStorage and sessionStorage

Categories : Jquery

Highlight A jQuery Radio Set among multiple
Use the Adjacent sibling selector on your CSS #radio input:focus + label, #radio2 input:focus + label { color: red; border: 1px solid black; } Your current selector #radio label:focus selects all focused labels, which isn't what you're looking for. jsFiddle Demo

Categories : Javascript

Jquery Highlight on preloaded input value
Use .triggerHandler() jquery's method: { in case of your jsfiddle, you have to set methods before calling it, or use wrap in HEAD } http://jsfiddle.net/bZYqK/2/ .triggerHandler('change')

Categories : Jquery

Jquery table search and row highlight
Change: if ($(this).val.indexOf(searchText) !=-1) { tr.addClass('result'); } else { tr.removeClass('result'); } to: if ($(this).text().indexOf(searchText) !=-1) { $(this).closest("tr").addClass('result');  } else { $(this).closest("tr").removeClass('result'); } val is a jQuery method, which is a function, it's not a string that you can search. And it's the wrong method for what you presumably want -- the contents of a table field is read with text() -- val() is for the value of a user input. And there's no variable tr -- you want to add/remove the class of the element's containing row. This can be further simplified to: $(this).closest("tr").toggleClass("result", $(this).text().in

Categories : Jquery

How to highlight certain table rows using jQuery?
One way would be to use the not() selector: $(this).parent().not('tr:first-child').addClass("gray-rollover"); This will add the class to all rows except for the first on mouseover. CodePen here.

Categories : Jquery

401 error with TypeScript mapping files in SharePoint 2010
You should be able to get this working by having the map files in a local location rather than relying on getting them from the server. You will need to update the path in the JavaScript files to point to your local map files to do this.

Categories : Javascript

Inaccessible module error in TypeScript declaration file
This is a compiler bug they introduced in Typescript 0.9.1 https://typescript.codeplex.com/workitem/1434 https://typescript.codeplex.com/workitem/1455 It is fixed in 0.9.1.1 release branch. You can get it from typescript.codeplex.com OR For a time being, you can replace export class Query<T extends Document> { exec(): Promise; exec(operation: string): Promise; exec(callback: (err: any, res: T[]) => any): Promise; exec(operation: string, callback: (err: any, res: T[]) => void ): Promise; skip(x: number): Query; limit(x: number): Query; } with export interface IExecCallback<T> { (err: any, res: T[]): any; } export class Query<T extends Document> { exec(): Promise; exec(operation: string): Promise; exec(callback: IEx

Categories : Node Js

TypeScript calling methods on class inside jquery function scope
You can do this: public Get() : void { $.get("/api/brand", (items) => { $.each(items, (i, item) => { this.Add(item.Id, item.Name, item.Active); }); }, "json"); } Which generates: BrandViewModel.prototype.Get = function () { var _this = this; $.get("/api/brand", function (items) { $.each(items, function (i, item) { _this.Add(item.Id, item.Name, item.Active); }); }, "json"); };

Categories : Javascript

Highlight selected date in jquery datepicker
You could use `beforeShow' event to set the date. JSFIDDLE $( ".datepicker" ).datepicker( {numberOfMonths: 2, beforeShow:function(){ $('#return').val($('#depart').val()); }} );

Categories : Jquery

Jquery datepicker: highlight 'today' when clicked?
You can override the jquery ui css.Try this jsfiddle /*selected date */ .ui-state-active{ color:red !important; } /*todays date*/ .ui-state-highlight{ border:none !important; }

Categories : Jquery



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.