javascript

how to call java script function from activex or dll in c#.

Hi, I have active-x class written in c# which is multi-threaded. I need to call javascript from my activeX. I tried it by Microsoft.mshtml . /*JS function do_Print() { control.setPage(this); control.scriptPrint(); } function report_back(report){ alert("Report:"+report); } C# public void setPage(mshtml.HTMLWindow2C...

Resizing cross-domain iframe

Hello, I've heard that it's possible to poll the url of an iframe for a hash to do something with it from the parent. What i need to do is set the height of a cross domain iframe dynamically. So whenever the height changes, the iframe sets its url to someurl#height. Now i need to access the hash (#height) from the parent, but it still w...

Ckeditor : How can i make few tags like h3 , h4 , h5 non editable in ckeditor

Ckeditor : How can i make few tags like h3 , h4 , h5 non editable in ckeditor open to js solution or css any will do ...

HTML File input JS events

Hello, Are there any JavaScript events in type=file input? I.E. I would like to add an extra file input upon selecting file in one of allready created: Diagram:] : file input 1 file input 2 file input 3 user selects some file in input 1 and JS adds new file input file input 1 - somefile.txt file input 2 file input 3 *NEW* file inpu...

javascript, wait for something to be true then run action

Well the title kindof says what I need. Because in Javascript timeouts asynchronous I need to know when something becomes true. I don't want busyloop. Came up with: function do_when(predicate, action, timeout_step) { if (predicate()) { action(); } else { setTimeout(do_when, timeout_step, predicate, action, timeo...

What wysiwyg editors can be load with ajax ?

Working on a blog application in C# with MVC and want to load a wysiwyg editor with ajax on a page. only not all editors works good to load with ajax. What editor works to load with ajax ? and what are your experiences doing this? ...

Jquery Dyndatetime datepicker "selected" date bug!

Hi, I'm using http://www.mechanicalmarksy.com/hosted/toolman/dyndatetime/example.html datepicker and everythings works fine, but one bug. When you select some date for example 20. and go to another (next, previous) month 20. is selected but it shouldn't be. I can't figure it out how to solve this. now is February and if you select 20...

Changing the position of a li element with a given class inside an ul ?

Hello people, I have a ul with several li elements, one of them will always have the class "active". How can I make the li.active element to always appear on top of the list? I cant't control the html output that produces this list, so I would have to do this with css (preferably) or javascript/jquery. I guess there is not a way to do ...

Set Image Src to Local File

I am writing a Firefox extension and would like the users to be able to change an image on a web page with a local image. Is it possible, using JavaScript, to change the image source with an image that is saved on the user's local machine? Let me know if you need more information. Thanks ...

How can I verify that all select boxes have a selected option through JavaScript or JQuery or...?

I have 2 select boxes on a page with a variable number of options in them. For instance: <fieldset> <label for="fizzwizzle">Select a Fizzwizzle</label> <select name="fizzwizzle" id="fizzwizzle" size="10"> <option>Fizzwizzle_01</option> <option>Fizzwizzle_02</option> <option>Fizzwizzle_03</option> ...

Ideas and solutions for validating this form is wanted...

I have a form which I need to validate the easiest and most safe way. This is for a classifieds website! Now, I have several categories which the user may chose from, and then with javascript I display subcategories depending on which category is chosen. The subcategories are actually DIV:s which have their display property set to eithe...

Fadeout Problem.

I have a SlideShow script. hier http://asexpress.de/SlideShow/slide_test.html <script language="JavaScript" src="SlideShow.js"></script> <script language="JavaScript"> function start() { var a = "1.jpg;2.jpg;3.jpg"; SlideShow.Init("container", {"imageURLs":a, "imageContainer":"imgContainer"}); SlideShow.Start(); } </scrip...

Javascript, odd behaviour in a closure.

Hello, I was toying (read: learning) around with Javascript and came across something to my understanding, seems very odd. It has to do with closures and a reference that seems to 'loose' its importance to the browser. The browser I am using is Chromium 5.0.307.7. Anyway, here's some code: HTMLElement.prototype.writeInSteps = function...

Can I establish a connection with other computer using JavaScript?

Is the following possible? There are 2 persons working on 2 different computers. Both are connected to the Internet. These users can communicate with each other using a JavaScript program run in a browser. I do not want to use a server. I want to use a P2P approach and I am wandering if it is possible to do it with the JavaScript? ...

Get selected Item from the list with JS

Hello, I have an html list with some items loaded. I am able to get the select list object using the following code var list = document.getElementById('ddlReason'); but I need help with figuring out how to detect which value has been chosen from the list Thanks ...

Pagination algorithm working incorrectly

I've got a fairly simple pagination algorithm here but it's not working the way I'd like it to. Currently it's displaying like this 1 2 3 ... 33 34 35 [36] 37 38 ... 47 48 49 50 When it should be displaying like this 1 2 3 ... 33 34 35 [36] 37 38 39 ... 48 49 50 Here's my code, I wrote it very quickly. It also seems to continuous...

Easy way to evaluate path-like expressions in Javascript?

If I have a JavaScript object such as: var x = {foo: 42, bar: {fubar: true}} then I can get the value true with var flag = x.bar.fubar. I'd like to be able to separate out and store the path "bar.fubar", then evaluate it dynamically. Something like: var paths = ["bar.fubar", ...]; ... var flag = evalPath( x, paths[0] ); Obviously I...

The regex test in jQuery's parseJSON returns false - why?

I don't understand why the test in jQuery's parseJSON function: /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@") .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]") .replace(/(?:^|:|,)(?:\s*\[)+/g, "")) returns false for the string: {"TermTitle":"some...

IE 8 defaultView equivalent

I need from document object or from a DOM element (i.e. a DIV) to know which is its window object. In Firefox I can do: document.documentElement.ownerDocument.defaultView but obviously in that AWFUL browser that statement not work!!! ...

Check if Variable in array javascript

Short code for checking if a variable also exists inside an array is needed. Im thinking something like this: var category='cars'; if (in_array(category, some_array)){ do stuff! } Is there any such function in js? Thanks ...