have a heart (and some tact)
Jonathan-
nice article. I appreciate the in-depth examples.
Well, it worked after a few changes (obvious ones, like the name of controls), i am very happy with this article that rocks!
Jonathan,
the regular expression you use to determine whether the cursor is inside a HTML-tag is incorrect.
You have this:
var cursphrase = /(>[^<]*?)(##_CURSORPOSITION_##)([^>]*?<)/
While it should be:
var cursphrase = /(<[^>]*?)(##_CURSORPOSITION_##)([^<]*?>)/;
Thanks a bunch Arjan. I guess I mistyped the gt and lt's when I did the article.
Can this be done in simple javascript?
I could not done it.
I don't even think it's impossible, but i would be quite glad if someone could contradict me.
Benyi: I'm not sure what you're reffering to. The cursor position code in the article is in javascript.
var rng = sel.createRange();
Does anyone know what the return type is for this? i'm using c# and u can't just declare var.
thanks a lot.
oh dont worry i found it :)
mshtml.IHTMLTxtRange
thanks
Hi Jonathon,
I have only just come across your site in the last few days whilst doing some research into MSHTML. Just wanted to say thanks as all the stuff you have on here has been very helpul.
Also wanted to say(as you are clearly to nice to do it yourself) that if Daniel doesn't understand the articles, he's an idiot and should find himself another career that doesn't involve the use of a computer. I know his post was a long time ago now but people submitting abusive posts to such a helpful site is really offensive.
You have my full appreciation, respect and support.
Hi Jonathan,
Not sure if I can use this code for my purpose but it seems like it can be tweaked. I don't really need to switch between design view and source. What I do need it when I select a word or more in the design view is to figure out is what the character position of the word I selected in Javascript.
Example:
"The big brown fox jumped over the lazy"
I select 'fox' which is the 16th character. I what 16 to be returned.
This is a great site. Keep it up. And that Daniel-what an asshole.
Great help. I am working on a html editor. This was the help i needed to solve my problem. Thank you very much and keep the good work up please.
Also i cant understand Daniel, i think he just needs more time and calmness while reading your article. I needed too, but finally it worked :-)
Greetings from germany
Christoph
Your arcticle help me a lot!
Thank you, i'm from Moldova :)
And this is very original site..
Robert Benyi, amigo mio, puta su madre!!
lololol
it's very useful content
Hi Jonathan,
Thanks for your arcticle, it's help me solved my problem. Your arctical is very useful.
I'm from VietNam.
VuTuanDuc
Thank you. It helps me a lot.
Hi Jonathan,
Thanks so much. This was very helpful. Your article gave me the clue as to how to approach this issue which I could not get elsewhere. However, I use bookmarks instead of text as it produces flickering in my tool.
Regards,
ps