javascript

In-browser HTML editor for tables?

I'm developing a website that publishes scientific articles, not as PDF but as HTML. As a input tool for the editorial team, we use TinyMCE for normal text plus a couple of custom plugins for footnotes and citations. But we are not really happy with TinyMCEs table controls. Everything but the most simple tables take way to long to write....

fbjs: get uid of current loggedinuser

i have to use fbjs for my current app. i was using the api.requireLogin function earlier but then i looked over at the docs and found the function has been deprecated and suggested to use FB.Connect.requireSession() instead. I wanted to know how do i get the uid of the current user? ...

How to sort two tables located side by side so that changes in one are reflected in the other

Suppose I have two tables A and B and each one has only 1 column. Each row in table A corresponds to each row in B, but I don't want them to be in one table. A B ------ ---------- car automobile bike train When I sort A alphabetically I should get A B ------ ---------- bike train car automobile ...

Is this scoping possible in javascript?

I am working on a javascript framework. I have several independent scripts that look like this: core.modules.example_module = function(sandbox){ console.log('wot from constructor ==', wot); return{ init : function(){ console.log('wot from init ==', wot); } }; }; this function is called from another external scri...

Should I cache document.getElementById() in a variable or call it everytime?

I'm having a lot of elements which are generated and referenced (mouseover, clicks, position changes) a lot of times. I have the ID's of those elements at hand. Is it wise to store the document.getElementById(ID) calls in a variable, or is it faster/just as fast/slower to call document.getElementById() everytime? var app = []; var app....

Javascript window.location search for "#" never returns true

I'm trying to set up a redirector so that when my AJAX functions change the hash part of the URI, the link is still directly accessible should it be copied and pasted. My current function is below; however, it always returns false! //If a hash is found, redirect it var current_uri = String(window.location); if (current_uri...

JavaScript injected form field does not appear in POST data

hey guys. I have a form that generates new input fields via JavaScript on click. the inputs are successfully added to the FORM with the desired naming convention. <input type="text" name="util_name0" id="util_name0" value="" /><br/> <input type="button" onClick="newUtil(this)" value="Add New" /> newUtil() adds: <input type="text" nam...

Hide/Show content when checkbox is clicked?

Hey, I have a code segment here: <div class="label"><%= f.label :course %> <span>(Does this relate to a specific course?)</span></div> <%= check_box_tag(:no_course) %> <%= label_tag(:no_course, "None") %><br /> <%= f.collection_select(:course_id, @current_account.courses.find(:all, :order => "name"), :id, :name) %> How c...

manage addEventListener() and removeEventListener() inside an object

I have a pseudo-class in javascript that has a method to add and remove listeners to two buttons. This is the code: function FirstObj(secondObj){ this.loginButton = document.getElementById("login"); this.logoutButton = document.getElementById("logout"); this.secondObj = secondObj } FirstObj.prototype = { manageListeners : funct...

Firefox plugin that can modify incoming data before the page processes it?

Hi, Say a webpage loads an external javascript at load, is there any such FireFox plugin that I could use to modify the javascript before the page actually processes it? (not just specifically javascript) Thanks in advance. (also I'm pretty sure Tamper Data plugin only changes header data and not actual content being received) ...

How do I add style to content in JavaScript?

Hi I have been working in a JavaScript file and my content has been working with phrases. Now I want to change the style of those phrases. The first function (see function swapFE) I want to change the font style of the phrase node to normal. And change the color of the phrase node to the color value (155, 102, 102). The second function (...

Assign click event inside click event

Inside of an onclick event, I'm binding another onclick event. But when I initiate the first event, the second always executes: var MiniMenu = { show : function(menu_id, element){ // this doesn't have any thing to do with the problem - I think position = $(element).offset(); $('#' + menu_id).css({ ...

HTML 5 specific element support in older browsers via Javascript?

Is there a javascript solution to make the canvas tag or the video tag in HTML5 behave more like HTML5 in older/current browsers that don't support it? The canvas tag should ideally behave like the it would in HTML5 supportive browsers, but the video tag is also good if it's replaced with alternate code. ...

How to embed Javascript widget that depends on jQuery into an unknown environment

I'm developing a javascript widget that depends on jQuery. The widget may or may not be loaded onto a page that already has jQuery loaded. There are many problems that come up in this case... If the web page does not have jQuery, I must load my own jQuery. There seems to be a delicate timing issue when doing this, however. For exam...

Silverlight to Javascript interop UTF encoding/decoding

How do I get both alerts, one invoked from silverlight and the other invoked from javascript, to show the same data in the same way. eg. ���� != ýÿýÿý System.Windows.Browser.HtmlPage.Window.Alert( data ); alert(parameters); Silverlight3 code, sending data to javascript function: System.Windows.Browser.HtmlPage.Window....

Shouldn't we use <noscript> tag?

I found some good cons here. The noscript tag only detects whether the browser has JavaScript enabled or not. If JavaScript is disabled in the Firewall rather than in the browser then the JavaScript will not run and the content of the noscript tag will not be displayed. Many JavaScripts are dependent on a specific feature or features...

Is Graceful degradation possible for everything? for every javascript and javascript frameworks functionality?

Is Graceful degradation possible for everything? for every javascript and javascript frameworks functionality? ...

Why do I need to escape the '/' character in JavaScript?

What exactly needs to be escaped in javascript strings. Or, more specifically, why does var snaphtml = '<script src="http://seadragon.com/embed/lxe.js?width=auto&amp;height=400px"&gt;&lt;/script&gt;'; give a syntax error? Escaping the final <\/script> seems to fix the syntax error, but this doesn't make sense to me as a javascript ...

How to make indication of mandatory fields and form's validation accessible for screen reader users?

When error message will come on validation if use have done something wrong then that error should be read by screen reader? Any Screen reader compatible, accessible, unobtrusive jquery form validation plugin? and how user will know which form field is mandatory? my question is not about to make form with fieldset, legend, and label? ...

interesting characters in URL in joomla

i have a URL that looks like this ......index.php?option=com_jumi&fileid=8&Itemid=34 i know that i can view the source of the file just by view source from the browser, but since i have FTP permission for the site, i would like to be able to edit the file. but i dont know which file to edit! how do i find out which file is this link...