-
-
Save zoechi/6e03d4589ba1af6c3df0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SO 29434359 | |
import 'dart:html'; | |
import 'dart:async' show Future; | |
main() async { | |
var exists = await urlExists('https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/autofocus'); | |
print(exists); | |
exists = await urlExists("https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement"); | |
print(exists); | |
} | |
Future<bool> urlExists(String url) async { | |
try { | |
await HttpRequest.getString(url); | |
return true; | |
} catch(error) { | |
return false; | |
} // examine response for errors | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p{ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment