javascript

[JS] getSelection on DIV contentEditable

Hi all ! I am trying to achieve project and i must do a WYSIWYG editor in JavaScript. I can't use an existing editor because I need use my plugins (for example a colorPicker or imagePicker).. For this time I have this HTML : <div class="K_editor" id="idExample"> <div class="K_links"> <div class="K_editor_link K_editor_linkB...

How to execute Javascript function in C++

Please tell me, how to include a javascript header file or javascript function in C++ code. The C++ code is written in Linux(UBUNTU)? Although i need to perform the above action only, but let me tell u my purpose of doing it, as i am intending to implement CTI (Computer Telephony Integration) operation. (Help will be appreciated) Than...

Why do spaces appear in my string?

Hello all, I have this function below which returns all IDs of checked boxes on my page seperated by a comma. It works great but the problem is, it seems to put a lot of white space after each checkbox ID. I can't seem to figure out why? /*Returns selected checkbox ID in string seperated by comma */ function get_selected_chkbox(){ ...

Expose C++ object to Javascript in Qt

Is there any way I can expose a C++ object/function to JavaScript running inside the QtWebKit browser in Qt? It's possible to expose ActionScript objects to JS code running inside the WebKit browser in Adobe AIR - I'm looking for similar functionality in Qt. ...

JavaScript getting complete code of element when mouseover or onclick

How can I get the complete HTML code of the element I'm mouseovering or clicking? Using document.onmouseover = function(e){ can I get the full underlying HTML code of the element which triggered the event? Right now, I am able to get the tag name or id or whatever. What I would like is the whole code. For example; if I'm mouseovering a...

parse xml to load and play .SWF files one after the other in flex3

hi, i have an array of .SWF files tht are parsed from xml using e4x , i loaded them into the loader obj, im listening to loadonComplete event. then i m able to play only the last file from the arraycollection.how to play the files from 1st to last.i have added only 2 files in xml.here is my code.plz help. private function resultHandle...

Showing popup in the new FB JS SDK

HI, I used to have an Href in my website, when users clicked on it, multi friend selector showed so they can incite their friends to my website. That was done using the following code: FB.ensureInit(function() { var dialog = new FB.UI.FBMLPopupDialog('XXXXXXX', ''); var fbml = 'Multi-Friend-Selector FBML' dialo...

JavaScript Module Pattern - What about using "return this"?

After doing some reading about the Module Pattern, I've seen a few ways of returning the properties which you want to be public. One of the most common ways is to declare your public properties and methods right inside of the "return" statement, apart from your private properties and methods. A similar way (the "Revealing" pattern) is ...

using .append to build a complex menu

To build a menu block which should be switchable with hide/unhide of the menu items, I'm using .append html. The code idea is this: navigat += '<h3 class="infoH3"> <a id="' + menuID +'"' + ' href="javascript:slideMenu(\'' + menuSlider + '\');">' + menuName + '</a></h3>'; navigat += '...

Javascript tabs: call event onclick

I got some code I need to change. it is build by others, and not very neat... There is a javascript tabcontrol, containing 4 tabs, which contains gridviews. All the 4 gridviews are build during the load of the page, but I want them to load, when you activate the tabs (as it is possible to watch the side, while you don't need the specifi...

Bug in jQuery's element creation ?

Hi Folks, $(document).ready(function(){ var _new_li = $('<li/>', { 'id': 'p', 'text': 'CLICKME', click: function(){ alert('fired'); }, data: { 'somedata': 'somedata', } }); _new_li.appendTo($("#example")); }); I receive an ...

How do I select an item out of a JavaScript array when I only know a value for one of the item's properties?

I have the following JavaScript object: { "DPI": "66.8213457076566", "width": "563.341067", "editable": "True", "pricecat": "6", "numpages": "2", "height": "400", "page": [{ "filename": "999_9_1.jpg", "line": [{ "test": "test 1", lineid: 22 }, { ...

Jquery mouseover event issues

Hi I am currently working on a project where I am using jQuery to animate a block of text on mouse over. The event listener is on the containing div (as shown by the code below) and works really well until the mouse is over the title (.views-field-title) which is absolutely above the containing div. The animation begins to jump almost a...

Javascript search and replace sequence of characters that contain square brackets

Hello all I'm trying to search for '[EN]' in the string 'Nationality [EN] [ESP]', I want to remove this from the string so I'm using a replace method, code examaple below var str = 'Nationality [EN] [ESP]'; var find = "[EN]"; var regex = new RegExp(find, "g"); alert(str.replace(regex, '')); Since [EN] is identified as a character set...

asp.net multiple textbox validation

Hi, I currently have 3 textbox controls on my page. I also have a required valdiator of each of the textboxes. However I only want the validator for a textbox to fire if there is text in either of the other 2 textboxes. If all 3 textboxes are empty then no validators should fire. Is there any way I can do this in javascript/jquery as ...

Passing different values from different form filed to javascript possibly on pressing enter

I need to pass a value to javascript from different form fields when the user hits enter, i.e.: a=form1.value b=form2.value etc. How can I do this? ...

Jquery Tools and Mootols Conflict

I am trying to make a jquery tool tip to open up a link in a mootools lightbox. Can you please help me... Here is my Code: Header <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <script language="javascript" typ...

How can I replace the contents of a scrollable div without jumping to the top?

I have a div with the overflow: auto style. It is populated via AJAX with a result table. The rows in this div are editable, and with each edit I refresh the contents. The problem is, if the user edits something at the bottom of the div, the refresh brings them back to the top. I had some luck using anchors with Firefox, but not all ...

How to handle huge table ?

I would like to display to user a table which contains ~500,000 rows. The table should be calculated based on a file (i.e. the table is known at the beginning, and does not change). I guess that building the HTML text of this table is not a good idea in terms of memory performance. So how can I build such table ? I would like user to be...

Implementing CodeMirror Syntax Highlighter

Hello all, I am trying to make use of this Syntax highlighter. I have tried to implement their example and I always seem to get this error in firebug: place is not a function else place(div); Here is my code, I thought it was a path issue, but everything looks right: <textarea id="code1" rows="20" cols="20"> select * from w...