javascript

Embedding Content (iframes) with an HTML 4.01 doctype?

I have some existing code that I have been tasked with upgrading to a valid doctype of HTML4.01 strict. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt; In the code I've come across an <iframe>, and this does not sit well with the w3 validator. <iframe OnLoad="javascript: LoadAddAtt...

Markdown live preview in Textarea?

Are there any Javascript Markdown editing toolbars or libraries that show the live preview within the textarea and hide the formatting marks (, _ etc), similar to TinyMCE's implementation? If not, how would I go about implementing this in jQuery? I'm currently using MarkItUp, which only shows the preview after the textarea, or in a pop...

Codeigniter URI and jquery/javascript

Hello, I have a method in codeigniter that looks like this, public function category() { //$this->output->enable_profiler(TRUE); //echo "Hello function called by ajax"; $table = $this->uri->segment(3); $content_id = $this->uri->segment(4); $data['content'] = $this->site_model->get_content($table, $content_id); $this->load...

access iframe with DOM

In the following code, the alert works fine and prints "DIV : IFRAME" as it should however it then says that cNs[1].childNodes[1].document has no properties. Html: <div id="WinContainer"> <div style="display: none;"><iframe id="frame1" name="frame1"></iframe></div> <div style="display: none;"><iframe id="frame2" name="frame2"></ifram...

Questions about Javascript Highcharts

Has anyone use the Highcharts Javascript charting library? I have a few questions about it: Does it support dynamic data? In other words, if I plot a chart and then want to update the data displayed on the chart, do I need to completely unload the chart and start over? Or can I update the chart's data in-place? Is there a way to hide ...

Printing in .Net

I am printing out a Gridview along with a Title. I don't print anything else on the page. That works fine. However I have a cell that is a template field that i do not want to Print. How can I exclude that cell? Here is some code that I have. <div id="Printmeonly" align="center"> <table width="100%"> <tr id="trtitle" style="display:...

Are there any proposals to amend JSON to officially allow unquoted property names?

The following is technically invalid JSON: { color: "blue", size: 14 } because the property names "color" and "size" are required by the spec to be quoted, i.e. { "color": "blue", "size": 14 } However, I've noticed that many web services that purport to return "JSON" do not quote their property names, and hardly anybody wri...

Using jQuery, how do I find all instances of a class that appear between another class

For example: <table> <tr class="highlight" id="click"> <td>Rusty</td> </tr> <tr class="indent"> <td>Dean</td> </tr> <tr class="indent"> <td>Hank</td> </tr> <tr class="highlight"> <td>Myra</td> </tr> </table> Say when I click on the hr with the id click how would I find all instances of class indent unti...

Accessing functions from within a Javascript Object (Javascript).

I am attempting to create a basic Hangman program. It's an array of tags which are assigned into an array of Objects (called Buttons). Each image is an image of a letter, so for example you would press the 'L' button, it would check whether this was in an WordArray (which is an array of chars), then it would act accordingly (to hide the...

GMarker onmouseout event fired too soon

Here's the situation: On my Google Map, I'm trying to open an html info window whenever the user moves its mouse over a GMarker. This window should be closed when the pointer is out of the marker. GEvent.addListener(my_marker, "mouseover", function() { MaCarte.openInfoWindowHtml(new GLatLng(my_marker.getLatLng().lat()+0.002, my_marke...

url, javascript

Hi, I have the code for you as follows:- first of all in the head tag I have following javascript:- <script type="text/javascript"> { function startmeup(urlname) player.url=urlname } </script> then I load windows media player <object id="player" type="video/x-ms-wmv" classid="CLSID:6bf52a52-and the rest" class="style" style="...

Firebug: "event is not defined"

Hi there. I have a constructor with these methods: function getMouseXY(event){ var x = event.clientX - this.offsetLeft; var y = event.clientY - this.offsetTop; return [x,y]; } function alertx(){ var c = this.getMouseXY(event); alert(c[0]); } In the HTML code i assign the alertx function to a HTML5 can...

Galleriffic with lightBox

For the relaunch of my clients site (craft2eu.net) I need to integrate Galleriffic with a lightBox. I know there is GallerificPlus, but it is based on an old version of Galleriffic which brings some things I don't like. For example the invalid attributes, etc. How do I integrate the current version of Galleriffic (2.0 at the time of wr...

Porting C# to javascript is causing scoping issues

Hi, I am trying to implement an algorithm I found in C# in javaScript and am facing some issues. Basically I am finding it difficult to pass by reference in JS. I have broken down the problem I have to the following example code, let say you have the following C#: using System; using System.Collections.Generic; using System.Linq; usin...

generate browser window screenshot

i have to work with multiple pages (tabs) at once and need to see how the different pages look like at any one instance. is it possible to take screenshots of open tab of Firefox/Chrome through Javascript? ...

Exception when assigning value to IXMLHttpRequest object in IE7 and IE8

Hi, I didn't write the following code and I am not a Javascript expert. So please excuse me if it seems to you a trivial bug. However here is the code: jQuery.ajax({ type: barobj.method, url: handler, beforeSend: function (request) { request.vote_id = vid; ... }, complete: function (request, textSt...

Javascript file- is function in error? Need help!

I am trying to see if my JavaScript file's function is written correctly in order to display "Sunday, December 24, 2006". So here is the function: function XmasDays(thisDate) { var XMYear = thisDate.getFullYear(); var XMDay = new Date("December, 25, 2005"); XMDay.setFullYear(XMYear); var dayTotal = (XMDay-thisDat...

Prototype Framework Breaking Other Scripts

I have a simple page that has a (non-Prototype) JavaScript pop-up for login. It has been working fine. But when I add the Prototype framework to the page the pop-up quits working. <script type="text/javascript" src="recipes/js/prototype.js"></script> <script type="text/javascript"> var imgnum = 1; function nextimg() { /* <![CDATA[ ...

JavaScript Postback on condition

I need help with the javascript below please. I have 2 text boxes and 1 button on my form. What I would like to happen is if User enters a value in textbox one and not textbox two, then event need not be fired. However, if there is a value in textbox one and then textbox 2 then I want a post back to fire. My code below does not seem to b...

Javascript template system - PURE, EJS, jquery plugin??

Hi there, has anybody used a javascript template system? I used to use the one that is embedded with JavascriptMVC but i now doing server side development so i wanted a more streamlined/thinner version.. I have found 2. 1 is EJS which is the part that is included with JavascriptMVC http://embeddedjs.com/ and the other is Pure- whic...