I can successfully generate a csv file by issuing an html form POST to a new window and use PHP to respond with:
header('Content-type: text/csv');
header('Content-Disposition: attachment; filename="'.date("Ymdhis").'.csv"');
print get_lines();
However, this leaves the the window open and blank.
I want to either close the window autom...
This is probably a nub question, but I don't understand why this works:
<script type="text/javascript">
alert(foo);
function foo() { }
</script>
This alerts "function foo() { }", but I expected the alert to be evaluated before the function foo was defined. Can someone explain what I don't understand about parse/evaluation orde...
Steve Jobs just posted this article on why Apple rejects Flash...
http://www.apple.com/hotnews/thoughts-on-flash/
I agree that javascript and css can be used to replicate some of Flash's animation, though Flash does all sorts of scaling and tweening that is incredibly powerful, and I'm not sure that there's anything comparable in javasc...
I just setup IntenseDebate on my blog this evening and am, for the most part, pleased with it. One thing I did see is that they offered me a small snippet to show the current number of comments:
<script>
var idcomments_acct = 'abcdefgef12345678mykey8675309acdc';
var idcomments_post_id;
var idcomments_post_url;
</script>
<script type="te...
Hey Guys,
I am using ThickBox 3.1 one one page.
Now, there is one problem,
i am using one form to open thickbox on the button click event.
And i am using yahoo text editor on that form.
And in the yahoo rich text editor there is one link of image insert.. but i don't know why its not opening. on click of it. the image insert dialog ...
Could someone please tell me what I am doing wrong? I'm not a newbie at programming but I feel like it tonight! Every time I increment the incrementing variable it throws a fit! When add one to it, it behaves fine, but if I try to add one more to it it wants to add 2 more. And then if I try to de-increment it wants to subtract from the o...
Is
for (var i=0, cols=columns.length; i<cols; i++) { ... }
more efficient than
for (var i=0; i<columns.length; i++) { ... }
?
In the second variant, is columns.length calculated each time the condition i<columns.length is checked ?
...
I'd asked a question about the splitting the a string like below:
Input string: a=>aa| b=>b||b | c=>cc
and the output:
a=>aa
b=>b||b
c=>cc
Kobi's answer was:
var matches = "a=>aa|b=>b||b|c=>cc".match(/(?:[^|]|\|\|)+/g)
His answer worked, but I need to use the .split() method and store the outputs in an array.
So I can't use the ...
Is there a way to generate an .xslx file from javascript and allow the user to download it by javascript? This page is geared towards being run offline in html 5 with no internet connectivity.
...
Need to capture content of root <pubDate> element, but in document it can be either within <item> element or within <channel> element. Also <item> is child of <channel> I'll bring example
<channel>
...
<pubDate>10/2/2010</pubDate>
...
<item>
...
<pubDate>13/2/2029</pubDate>
...
</item>
...
</channel>
need to ca...
I don't end my JavaScript statements with semicolons when newlines will work. No flames, please. My question is, is there an automatic indentation package for vim that will work?
Here is an example of how dumb it is:
$(function(){
var foo // code starts here,
// The following line breaks things, but adding a comment to it fix...
I'm trying to learn jQuery by implementing a simple menu. I've got <div> elements that act as buttons and have links in them. I'm trying to add onclick events to the divs that navigate the browser to the link's address in the div. This is basically my pseudo-code. What would the real code be? How can I improve this? Any feedback apprecia...
I need a similar function in PHP for this JavaScript function
text = text.replace(/ffc/g, "Hello");
I think preg_replace will do, but i'm not sure how to write the expression..
I want the regular expression similar to "/ffc/g" which is above, What I need exactly is to match the full word and case when performing the replace...
Thank...
Any example on how to parse/have access to simple RSS feed elements in JS?
I don't want to use any Microsoft specific objects.
...
I'm trying to use SMIL to animate the typing of text into a field embedded in a SVG. I tried the following code in both Chrome and a SMIL-enable Firefox nightly, but it has no effect:
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:html="http://www.w3.org/1999/xhtml">
<foreignObject>
<html:input type="text" value="">
<...
I am new to Drupal and am trying to create a node (let's call it child) that will only really be accessed when clicked on from another node (we'll call it parent). When closing the child window, I want to parent window to refresh.
Outside of Drupal, that's easy:
<a onclick="window.close(); window.opener.location.reload();" href="#">Cli...
I've seen this done in a lot of sites recently, but can't seem to track one down. Essentially I want to "disable" an entire panel (that's in the form on an HTML table) when a button is clicked.
By disable I mean I don't want the form elements within the table to be usable and I want the table to sort of fade out.
I've been able to acc...
In Javascript, I am sometimes too immerged in the idea that a function creates a new scope, that sometimes I even think the following anonymous function will create a new scope when it is being defined and assigned to onclick:
<a href="#" id="link1">ha link 1</a>
<a href="#" id="link2">ha link 2</a>
<a href="#" id="link3">ha link 3</a>
...
I have an ant build that concatenates my javascript into one file and then compresses it. The problem is that Visual Studio's default encoding attaches a BOM to every file. How do I configure ant to strip out BOM's that would otherwise appear in the middle of the resulting concatenated file?
My googl'ing revealed this discussion which i...
Hi all. I have been successful in dynamically loading an album in SSP before, but using SSP Standalone. I did it like this:
var flashvars = {
xmlFilePath: "http://site.com/ssp_director/images.php?album=5"
}
What I'm looking to do now, though, is dynamically load a gallery when the page loads, using text entered in the javascript, ...