It looks like this:
var objDiv = document.getElementById("code");
objDiv.scrollTop = objDiv.clientHeight;
works in Chrome, but not FF, and this:
var objDiv = document.getElementById("code");
objDiv.scrollTop = objDiv.scrollHeight;
works in FF, but not Chrome.
Is there a better all around way to do this?
I'm trying to use a regex like /[computer]{3,8}/ to get any words containing only the letters in computer ranging from 3 to 8 letters long. That regex instead captures all words containing ANY of the letters in [computer]. I've been looking at regular expression examples, but i can't quite figure it out...
How do i modifiy this regular expression to capture words containing ONLY the letters in computer (with a length of 3 to 8)?
I am trying to make simple list with ability to add and delete elements. For now I am working on adding and performing a simple action on each of list elements object (existing and added). Unfortunately I have met some difficulties with that. I am able to modify objects that are created at the beginning, but not one added during "webpage working".
First of all my idea was to add AJAX to this, but I don't think it is the easiest way.
I think that some time ago (I don't remember where) I read how to make this work, but now I don't know. I would be really glad if someone would help me with this or at least give a link to good explanation of this.
There is what I have done so far (well this is mostly just a scratch, but the main idea is in it): http://jsfiddle.net/sebap123/pAZ7H/
Thank you for all responses.
I was looking through the jQuery code and found that isArray is implemented using the built-in function toString. I cannot find the documentation for this function on MDC. Does the doc exist? What does this function do?
isArray: function( obj ) {
return toString.call(obj) === "[object Array]";
},
We are developing a web application and the framework under it. I would like to be able to use the framework for other projects and I am even considering making the framework open source.
Right now each developer has 2 separate folders, one for each. I then have a 3rd folder with symlinks to the files in the to git project folders. This works but we have pull both the framework and the app and if they get out of sync nothing works.
We are going to be starting the second app using the framework soon.
Is there a better way to do this?
Is it possible to rewrite the URL in the URL-field on the client's browser?
So when a person clicks on a link on my page something ajax happens (eg a tab shows up) i want the url to display the action without refreshing the page.
Is this possible?
I'm learning Jython.
I developed a simple Swing Application with Jython and it's ok.
Now I would to use the Swing Application Framework (JSR 296).
I did not find any example in Internet.
In my Zend Framework modules, I have views that require specific scripts, CSS and images.
Is that possible to include them in the module in a way that I don't have to copy them in each project that uses the module ? (because the "public/" folder is not part of the module, but specific to each application)
If not, how can I do ?
Thanks !
I have a constructor that has a series of classes and functions within it - in each function I check if the param is set to show the error and output if so. Like so using an inline if. The issue and question is short of keeping two versions is this approach not wise in that each IF has to be evaluated thus adding to the time it takes to perform?
debugSlide = (bag.debug==1)? console.log("item id =" + bag.itemId) : 0;
How do you do this? Any pointers on where I can find tips on this? Thanks in advance!
I have a simple Zend Framework that has a view script to add records to the database. This is a silly question IMHO, but how can I use the add view script to edit the record as well??
I have played around with a few scenarios to no avail.
Thanks,
Steve
If I were to define two objects myDataStore and myDrawer something like this:
var myDataStore = function(myObjectRef) {
this.myInternalObject = myObjectRef;
};
var myDrawer = function(myObjRef) {
this.myInternalObject = myObjectRef;
};
And if I were to create an object like so:
(function(){
var myObject = window.myObject = function(){
this.dataStore = new myDataStore(this);
this.drawer = new myDrawer(this);
}
})();
Then myObject.dataStore.myInternalObject, and myObject.drawer.myInternalObject, would simply be pointers back to the original 'myObject' - not taking up any additional memory in the browser. Yes?
I am interested in implementing techniques like this - as it makes it easy for objects to communicate with each other.
Hi, I like to add (+1) to a number. But problem is my number can sometimes have 0 preceding it. Like 01, 02, 03, 04. So I like result to be:
mockup01 + 1 = mockup02
mockup11 + 1 = mockup12
How can that be achieved? Example of how I would use it would be if I had filename named mockup_01.htm and change it to mockup_02.htm
Thanks!
I mean, assume a web page is very long and contain lots of words, now i just want to get the value of a textnode which is being shown on the screen.How could i do it? Thanks! :)
what's more:
I mean, i know how to get the value of a textnode,but if a web page is very lage and contains thousands of words, what i want to do is that,only get the shown textnode of the dom tree.That means if you slither a mouse wheel,some text disappear and some come into your vision.
HI Guys,
I was watching these videos series about Entity Framework:
http://msdn.microsoft.com/en-us/data/ff191186.aspx
is that easy building application in real world programming??? and is it ....reliable...has good performance...
"I am a graduate.."
thanks
I want to change the iframe source when something change in this iframe content, the iframe is in a different domian than the parent page. is this can be done or not?
I just need to add a hash to this iframe src, so that i can access this hash value from the parent page and do some stuff based on this value.
What i did:
In the iframe page i wrote: window.location.hash = "close_child";
and in the parent page i wrote: if (document.getElementById("MyIFrameId").src.indexOf("#close_child") > 0) { but i always find that the src is empty
Hi guys,
I have a project to move some JS code outside of rails into the public direcotry, but some of it has ruby code embedded, and depends on the values of the variables from the controllers to set some of its code. How can I move it out of the view and still maintain the same structure, or do I need to just rewrite the JS from scratch?
Can anyone recommend a good book on zend framework. I got ZF up and running but I want a more complete reference with maybe something that talks about each module more in depth.
Is there such a book. There seems to be real slim pickings on ZF books
I was thinking if there's a better solution for adding onclick handler to each cell in a table than this approach: http://stackoverflow.com/questions/1207939/adding-an-onclick-event-to-a-table-row
Better in the way that I wouldn't need to set "cell.onclick = function" for each cell.
I just need to get the coordinations of a cell where user clicked.
Thanks!
I'm trying to change the src of an image form submit button using an onclick, but it doesn't seem to be working correctly. Am I missing something?
<input class="submit_image" id="my_form_button" onclick="$('my_form_button').src='/images/buttons/submitting.gif'" src="/images/buttons/submit.gif" type="image" />
I've also tried using the same JS on the form tag using onsubmit with no luck.
I would like to use "ON DUPLICATE KEY UPDATE" in Zend Framework, is this possible?
Example
INSERT INTO sometable (...)
VALUES (...)
ON DUPLICATE KEY UPDATE ...