Eval’ing with IE’s window.execScript
Plaxo’s Joseph Smarr has been playing with on-demand javascript, i.e. downloading extra JS code after the page has already loaded. When you grab the code via a remote call and eval() it, it doesn’t get into global scope. So here’s how he dealt with it.
Here’s a simplified version of the situation we faced:
function loadMyFuncModule() { // imagine this was loaded via XHR/etc var code = 'function myFunc() { alert(\"myFunc\"); }'; return eval(code); // doesn’t work in FF or IE } function runApp() { loadMyFuncModule(); // load extra code “on demand” myFunc(); // execute newly loaded code }The thing to note above is that just calling eval() doesn’t stick the code in global scope in either browser. Dojo’s loader code solves this in Firefox by creating a dj_global variable that points to the global scope and then calling eval on dj_global if possible:
function loadMyFuncModule() { // imagine this was loaded via XHR/etc var code = 'function myFunc() { alert(\"myFunc\"); }'; var dj_global = this; // global scope object return dj_global.eval ? dj_global.eval(code) : eval(code); }This works in Firefox but not in IE (eval is not an object method in IE). So what to do? The answer turns out to be that you can use a proprietary IE method
window.execScriptto eval code in the global scope (thanks to Ryan “Roger” Moore on our team for figuring this out). The only thing to note about execScript is that it does NOT return any value (unlike eval). However when we’re just loading code on-demand, we aren’t returning anything so this doesn’t matter.The final working code looks like this:
function loadMyFuncModule() { var dj_global = this; // global scope reference if (window.execScript) { window.execScript(code); // eval in global scope for IE return null; // execScript doesn’t return anything } return dj_global.eval ? dj_global.eval(code) : eval(code); } function runApp() { loadMyFuncModule(); // load extra code “on demand” myFunc(); // execute newly loaded code }And once again all is well in the world.
Source: Ajaxian
Original Article: http://ajaxian.com/archives/evaling-with-ies-windowexecscript
The TechCrunch20 Conference
I am very excited to announce a new conference, called the TechCrunch20. This is a joint venture between us (TechCrunch) and Jason Calacanis, who broke the news about this earlier today. The format is simple: Twenty of the hottest new startups will announce and demo their products over a two day period. And they don’t pay a cent to do this.
Many tech conferences today allow startups to pitch and demo their products to their attendees, although there is almost always a hefty fee involved that ranges from thousands to tens of thousands of dollars. DEMO, where I am currently, is .probably the quintessential example of this model. The entire conference is paid startup demos. There are way too many to digest - 60 - and it is a well known secret that if you are willing to pay the $15,000+ fee, your startup will really need to suck to be turned down.
While conferences like DEMO are extremely lucrative for the organizers, I’m not sure the startups or attendees attending get much out of it other than a great networking event. There are too many startups for press to give even passing coverage to many of them, and attendees are lost in a sea of pitches that all begin to blur together.
And there is a serious conflict of interest at the conference level. The economics of the event dictate that a certain number of startups must be accepted for a certain fee. Attendees don’t know if they’re really seeing the best startups, or just the best startups that are willing to pay the exhorbitant participation fee. A few (or a lot of) duds always make their way in.
Many of the hottest startups over the last couple of years - Digg, YouTube, StumbleUpon and many others - didn’t have the money in the early days to spend on DEMO and other conferences, and so they didn’t participate. We want to give the future YouTube’s a platform to announce those products.
The TechCrunch20 Conference
Jason and I are going to do something a lot different that they pay-to-demo model. The TechCrunch20 conference will be a two day event, held this fall (more details soon), where twenty hot startups will demo their new products. And they don’t pay a dime to do this.
The startups will be invited based on the recommendation of a committee of expert analysts, entrepreneurs and journalists. Twenty companies will be invited, plus a couple of alternates. If a selected startup isn’t ready to launch ten days or so before the event, they’ll be bumped and one of the alternates will take their place.
Jason is the perfect partner for us to work with on this conference. He’s a successful entrepreneur and has held large startup-focused conferences in the past. It is our hope that his experience and our access to new startups will be a winning combination.
More details on the TechCrunch20 conference will be announced soon.
Crunch Network: MobileCrunch Mobile Gadgets and Applications, Delivered Daily.
Source: TechCrunch
Original Article: http://feeds.feedburner.com/~r/Techcrunch/~3/84596630/
Sound with JavaScript but not Flash
Reinier Zwitserloot wanted to see if he could add sound support without embedding a Flash bridge, and shared his research in his article on Sound in Web Browsers without Flash.
Check out his test page for a Sound Check
An example API
-
-
function sound2Play() {
-
if ( !sound2Embed ) {
-
sound2Embed = document.createElement("embed");
-
sound2Embed.setAttribute("src", "machinegun.wav");
-
sound2Embed.setAttribute("hidden", true);
-
sound2Embed.setAttribute("autostart", true);
-
} else sound2Stop();
-
sound2Embed.removed = false;
-
document.body.appendChild(sound2Embed);
-
}
-
-
function sound2Stop() {
-
if ( sound2Embed && !sound2Embed.removed ) {
-
document.body.removeChild(sound2Embed);
-
sound2Embed.removed = true;
-
}
-
}
-
Source: Ajaxian
Original Article: http://ajaxian.com/archives/sound-with-javascript-but-not-flash
[Sunspots] The intuition edition
- Business advice from David Lynch?
- “Intuition is the key to everything, in painting, filmmaking, business—everything. I think you could have an intellectual ability, but if you can sharpen your intuition, which they say is emotion and intellect joining together, then a knowingness occurs. Feeling correct is a feeling I think everyone knows.”
- Steve Ballmer spends one-third of his time meeting with customers
- “I get energy from seeing our customers. It reminds me of the things we’re doing well and it also reminds me of the things where we need to improve.”
- You only get three seconds to make an impression
- “People have forgotten that the most important thing on a website is the content. Not the gradient, not the drop shadow, not even that PhotoShop brush that you thought would be cool as a background image. If your content doesn’t say interesting stuff in a concise manner, then no amount of CSS Zen will help. Writing for the web is the toughest and most important part of developing web sites/applications. Get that wrong, and every other part of the design process from your information architecture through to your IE5.5 on OSX CSS hacks just doesn’‘t matter.”
- Video: Real worldish use of multi-touch driven screens
- Jeff Han and Phil Davidson demonstrate how multi-touch screens “will change the way we work and play.” Examples include usage in image editing, web browsing, creating 3D animations, etc. [tx ML]
- Fotolog neck and neck with Flickr
- “Perhaps this is a sign that those folks trapped in the Web 2.0 bubble are not being critical enough about what is responsible for success on the Web circa-2007…Maybe tags, APIs, and Ajax aren’t the silver bullets we’ve been led to believe they are. Fotolog, MySpace, Orkut, YouTube, and Digg have all proven that you can build compelling experiences and huge audiences without heavy reliance on so-called Web 2.0 technologies. Whatever Web 2.0 is, I don’t think its success hinges on Ajax, tags, or APIs.”
- SmugMug discusses Amazon S3 problems
- “I can’t think of a particular vendor or service we use that doesn’t have outages, problems, or crashes. From disk arrays to networking gear, everything has bad days. Further, I can’t think of a web site that doesn’t, either. It doesn’t matter if you’re GMail or eBay, you have outages and performance problems from time to time. I knew going into this that Amazon would have problems, and I built our software and our own internal architecture to accommodate occasional issues. This the key to building good internet infrastructures anyway. Assume every piece of your architecture, including Amazon S3, will fail at some point. What will you do? What will your software do?”
- Setting small goals creates sustainable change
- “When someone goes from one extreme to another, the behavioral change rarely lasts. In my experience, this is true in personal finance, fitness, studying, and a bunch of other areas. When I make a change, I almost always make the most incremental change of all and work iteratively from there. This is why I just shake my head when I see personal-finance pundits giving families advice to go from a 0% savings rate to a 25% savings rate (“you can do it!!!”). Giving that kind of advice to someone is not useful if their habits have been set for years. That’s why you find articles like 8 lottery winners who lost their millions. Habits don’t change overnight, and if they do, chances are it won’t be sustainable.”
- Jeff Veen's CMS suggestions (e.g. give customers quick wins)
- “Make it easy to get started. Give first-time users a series of quick wins that become increasingly complex. When I first log in, I want to create a Web page. Next, I’d like to add some styles to it. Then, I’d like to make links to some other Web pages. I’ll build a navigation system after that, and start to add other features eventually. But I want to feel successful with your system within a few minutes. I don’t want to you to present the stunning power at my fingertips until I’m comfortable with my surroundings. Please save the content ranking, on-the-fly PDF creation, community forums, and user polls for later. I may eventually want that stuff, but not the first time I log in.” [tx WH]
- Released: PackRat 1.0 lets you use your Backpack data when you can't be online
- “Before you hit the road for the first time with PackRat, just sync up with Backpack and your data is duplicated in PackRat’s database…When you get back on the ‘net, PackRat will automatically inform Backpack of all your changes and Backpack will be up to date.”
- Tech barons trying to change energy policy
- “The venture capitalists could become a powerful part of the realignment of energy politics. They are lending a new voice to the debate, one that politicians are likely to listen to given the investors’ reputation as smart backers of next-generation companies.”
Source: Signal vs. Noise
Original Article: http://www.37signals.com/svn/posts/243-sunspots-the-intuition-edition
Personal Change
i am drawing pictures based on titles
suggest more titles for drawings or other ideas.
Source: Signal vs. Noise
Original Article: http://www.37signals.com/svn/posts/242-personal-change
[Link It Up] Great buildings
What’s your favorite building? Link it up.
For example…
Source: Signal vs. Noise
Original Article: http://www.37signals.com/svn/posts/241-link-it-up-great-buildings
[Fireside Chat] Seth Godin and Mark Hurst (Part 2 of 2)
Continued from Part 1...
Source: Signal vs. Noise
Original Article: http://www.37signals.com/svn/posts/238-fireside-chat-seth-godin-and-mark-hurst-part-2-of-2
Synchronous Calls and Browser Freezes
Mark Pruett did some experimenting with a hypothesis:
After launching a synchronous call, other browser windows or tabs will be frozen, and the asynchronous calls will not be serviced until the sync call completes.
For my experiment, I open up a browser window, then open a second browser window using the “New Window” menu option. This will (hopefully) assure that both windows are part of the same browser process.
In window #1, I load my synchronous test and start a server request with a delay of 60 seconds. In window #2, I load the asynchronous test with each of the five tests set to three seconds.
The results showed that browsers are playing nicely. Almost. Firefox didn’t past the test in the current stable versions, but the nightly build was later tested and it was happy.
Source: Ajaxian
Original Article: http://ajaxian.com/archives/synchronous-calls-and-browser-freezes
Yahoo’s Brand Universe Launches
Yahoo’s brand-centric sites, announced in November 2006 and dubbed “Brand Universe”, have started to go live. These sites each revolve around a single popular brand - like this one on the Nintendo Wii - and have almost no original content. Instead, Yahoo is taking content from Flickr, Del.icio.us, Yahoo Answers and other Yahoo properties, along with some slick graphics, and hoping for page views.
Yahoo says to expect 100 or so brand-based sites by the end of the year, and will include sites for popular movies, TV shows, bands, celebrities, games, etc. The next sites to be launched will include the Sims, Halo, Lost, the Office, Transformers, and Harry Potter, says GigaOm.
Yahoo doesn’t seem too concerned with monetization of these pages yet, and they aren’t working directly with the brands themselves. Chances are both of those policies may change in the near future.
Crunch Network: CrunchBoard because it’s time for you to find a new Job2.0
Source: TechCrunch
Original Article: http://feeds.feedburner.com/~r/Techcrunch/~3/84416358/
Technorati’s Mysterious Disappearing WTF Product
Steve Rubel somehow came across a new Digg-like Technorati product called “WTF,” which stands for “Where’s the Fire?” It was briefly live at technorati.com/wtf, but is no longer available.
From the screen shots (see below, care of Rubel), it appears to have very similar features as Digg, where users can vote for stories they find interesting and force them higher in results.
I’ve emailed Technorati for a comment but haven’t heard back yet. This may be a product that they did not intend be available for public scrutiny quite yet, and Rubel’s post may have resulted in them removing it.
Technorati launched a TechMeme-like site called Technorati Explore in early 2006. I just checked it on a whim to see if it was still live - and it’s been removed as well. I can’t find any announcement of the product going dark, so it may have been any time in the last few months.


Crunch Network: MobileCrunch Mobile Gadgets and Applications, Delivered Daily.
Source: TechCrunch
Original Article: http://feeds.feedburner.com/~r/Techcrunch/~3/84408626/



_r.jpg)
