thanks that works fine.
But would that create any adverse effect if im testing it in a checked out repository (from SVN, CVS or sort) and then commiting the changes later?
Well anyway i just wanted to know if it was a good idea so thanks :)
User Profile
Collapse
-
mocking a resource like a directory in unit testing
I need to mock a resource like a directory in one of my unit tests.
The method is checking if the directory exists and i don't want to create a directory just for testing purposes so is there anyway to mock the resource without actually creating it or is it a good idea to create the directory when setting up the fixture? -
if you need to change and already assigned event handler and also retain the previous function the you can do something like this:
[CODE=javascript]var combobox = document.getEle mentById("combo boxid");
var oldFunc = combobox.onchan ge;
if (typeof oldFunc == "function") {
oldFunc();
//your code here
} else {
//your code here
}[/CODE]
and in your case maybe something...Leave a comment:
-
andho replied to Return focus to failed validation field after user clicks to get rid of error messagein Javascript1. your <form> tag doesnt seem to be closed.
2. the onsubmit="retur n ValidatehostFor m();" attribute is not in the uncommented form tag, but it is correclty specified in the commented out tag. Maybe its an asp thing. (i dont know asp)
3. no need for "return ValidatehostFor m();" in the onclick event of the save buttonLeave a comment:
-
why are you posting on a new thread??
i would recommend editing that file with a test editor that: strips all whitespace from the start and end of the file. i dont know any free software that does that. Zend studio does it.Leave a comment:
-
its as the error says: invalid command
there should be a space after "DocumentRo ot" and i dont think that "Line 466" belongs there either...Leave a comment:
-
it is technically linked from the php code right :D
and you dont need the WHERE clause in your first query now so they will be something like this:
[CODE=php]$sql = "SELECT member_id, first_name,last _name,category, title,message FROM Members WERE member_id=membe r_id";[/CODE]
NOTE: that member_id is in the Select Column list.
now for the loop you should take the member_id like so:...Leave a comment:
-
i am gonna put this part on hold for now as its taking too much time.
but i came up with this code upto now:
[CODE=javascript]if (xmlHttp.busy) {
xmlHttp.queue[xmlHttp.queue.l ength] = this.functionNa me;
} else {
xmlHttp.caller = this;
xmlHttp.open(ur l, 'GET', true);
xmlHttp.onready statechange = function () {
if (xmlHttp.readys tate == 4) {
// code to handle response here...Leave a comment:
-
remove the lines with these code:
Code:session_start(); session_register("username"); session_encode(); $url="Location:loggedin.php?PHPSESSID=".$PHPSESSID; header($url);
That error message is caused if any output is given...Leave a comment:
-
document.write will write to the object from within it is called, for example if it was inside a div it will write to that div erasin everythin inside the div.
so whats happening here is your calling document.write from within the head. I guess it is erasing everything in the document and writing your string to the empty document.Leave a comment:
-
thanks for the suggestions.
I tried IE developer toolbar. couldnt get around to javascript debugging with that. All it showed was the DOM i think.
gonna try firebug liteLeave a comment:
-
Javascript is always in an HTML file or included in an HTML file. AJAX is a javascript thing so actually there will be no AJAX files.
AJAX works by sending an HTTP request without reloading the current HTML file that it is in so that the whole HTML file doesnt have to load all over again.
Hope this helps.Leave a comment:
-
-
-
yes i think i know the problem here. i'll think about this and post a solutionLeave a comment:
-
-
the same happens in this last solution too.
the event doesnt know the xmlHttpRequest that it was called from? any way to keep track of this. to keep track of where or from what it was called?Leave a comment:
-
if ur using script.aculo.us then it might be complicated.
you could use firefox with firebug to debug this, it would make it easier.
You can check if the form has the attributes before the scriptaculous script is run and check it afterwards, using firebugLeave a comment:
-
u cud use something like this
[HTML]<input name="name" type="text" onkeyup="valida te(event);" />[/HTML]
and the javascript function
[CODE=javascript]function validate(e) {
if (this.value.len gth < 6 ) {
var nameerror = document.getEle mentById('namee rrordiv');
nameerror.inner HTML = "name should be longer than 6 characters";
}...Leave a comment:
-
no that doesnt work because the event handler doesnt know which caller is for which even.
i guess i have over looked something here. maybe i should create a different xmlHttpRequest for each object. that will work right.Leave a comment:
No activity results to display
Show More
Leave a comment: