Questions tagged [dart-html]

Dart HTML allows access to basic browser features like the DOM, FileSystem, Websockets and other things.

Dart HTML provides access to basic browser features like the DOM, FileSystem, Websockets and other things. It doesn't provide the same interfaces to the DOM that JavaScript has, but provides a much richer interface to the DOM. Some browser features, like SVG, WebGL and Web Audio have their own libraries.

dart:html library

Connect Dart & HTML

474 questions
40
votes
3 answers

How to use setInterval/setTimeout in Dart SDK 0.4+

I realised that in current Dart SDK version 0.4.1.0_r19425 methods like setTimeout, setInterval, clearTimeout, clearInterval aren't part of Window class any more and they all moved to WorkerContext. Is there any documentation on how to use them now?…
martin
  • 93,354
  • 25
  • 191
  • 226
32
votes
1 answer

Parsing a URI to extract query parameters, with Dart

I have a request in this form: http://website/index.html?name=MyName&token=12345 Is there a way how to extract name and token from this url? There is always an option to iterate through all characters and save it that way, but I am looking for more…
Vilda
  • 1,675
  • 1
  • 20
  • 50
26
votes
4 answers

How to timeout a future computation after a timeLimit?

When defining a Future as follows: Future httpRequest = HttpRequest.request(url, method: method, requestHeaders: requestHeaders); I want to handle a timeout after 5 secondes. I'm writing my code like this…
bwnyasse
  • 591
  • 1
  • 10
  • 15
20
votes
1 answer

How do I drive an animation loop at 60fps with Dart and the web?

How do I drive an animation loop or game loop at 60fps in a Dart web application?
Seth Ladd
  • 112,095
  • 66
  • 196
  • 279
18
votes
3 answers

CORS with Dart, how do I get it to work?

Just started tinkering with Dart and I decided to write a simple Http Server and a client. My server code: #import("dart:io"); final HOST = "127.0.0.1"; final PORT = 8080; final LOG_REQUESTS = true; void main() { HttpServer server = new…
jwesonga
  • 4,249
  • 16
  • 56
  • 83
13
votes
1 answer

Get access to an object's property using bracket notation in dart

I try to do the following: var properties = ["height" , "width"]; for (var prop in properties){ div.style[prop] = otherdiv.style[prop]; } But dart doesn't seem to accept this bracket notation, is there any other way to access a property using a…
90intuition
  • 966
  • 3
  • 12
  • 25
8
votes
4 answers

What's the difference between "dart:html" and "dart:dom" package?

I'm starting with some of the Dart examples. Then I wanted to query the DOM with document.query('#someId') as described here, but it seems there was no query method in document. Also creating a new element by `new Element.tag('p') doesn't work.…
Andreas Köberle
  • 106,652
  • 57
  • 273
  • 297
8
votes
1 answer

Get Variables name by it's value in Dart Lang

For Example, I have a variable like this. var fooBar = 12; I want a something like this in Dart lang. print_var_name(fooBar); which prints: fooBar How can I achieve that? Is this even possible? Thank you.
Mr.spShuvo
  • 428
  • 4
  • 12
8
votes
3 answers

How can I print multiple objects to console.log with dart?

In javascript, if I have 3 variables like this: var x = 1 var y = 'cat' var z = {color: 'blue'} I can log all of them like this: console.log('The values are:', x, y, z) In dart, you can import 'dart:html' and it will map print to console.log in…
cilphex
  • 6,006
  • 6
  • 34
  • 44
8
votes
6 answers

Dart Removing disallowed attribute after editor upgraded

I have encounter error "Removing disallowed attribute" after I upgraded my dart editor in SDK 0.7.3.1_r27487. I have a custom tag which template contains boostarp attributes "data-target" and "data-toggle". It work under previous version but…
Roger Chan
  • 1,293
  • 2
  • 11
  • 24
8
votes
1 answer

Dart login/logout example

I'm trying to find a simple example of user authentication with Dart. So far the closest I've found is https://github.com/dart-lang/bleeding_edge/blob/master/dart/tests/standalone/io/http_auth_test.dart. Can anyone direct or provide me to a working…
basheps
  • 10,034
  • 11
  • 36
  • 45
7
votes
1 answer

Changing App Layout Drawer persistent to temporary at media change in AngularDart

I have an App Layout of angular components in my AngularDart project. How can I change the drawer of App layout from persistent to temporary at the change of media screen?
Tushar Rai
  • 2,371
  • 4
  • 28
  • 57
7
votes
1 answer

Add extra headers to websocket connection from browser in Dart

I'm trying to establish an authenticated websocket connection, and this question is a sibling to similar question for server part. How I can add extra headers when I establish a websocket connection from browser? I'm trying to use dart:html's…
Mike
  • 738
  • 8
  • 12
7
votes
4 answers

How to animate scrolling in Dart?

I want to make a smooth scrolling to a section of my page. In jQuery is done so: $('html, body').animate({ scrollTop: $('#anchorOfMyTargetSection').offset().top }, 'slow'); In Dart, I can make the scroll, but i have no idea of how to animate…
Edder
  • 141
  • 7
7
votes
1 answer

HTML Tags Within Internationalized Strings In Polymer.dart

I am displaying internationalized strings within a Polymer element as follows:
{{title}}

{{subtitle1}}
{{paragraph1}}
Peter
  • 1,720
  • 3
  • 18
  • 30
1
2 3
31 32