As I've come to understand using $('.whatever').click() only works for items created initially. Additional items won't respond in the correct fashion. I was then directed to using something like $('.whatever).on('click', myFunction()). However, I'm not detecting any difference, as newly created items are not called.
Here is a JSFiddle demonstration my example code: http://jsfiddle.net/atrus6/zaKZN/
My initial input plus 'Kill' will work in the correct fashion, however any additional 'input + kill's will not not do anything. Am I incorrectly using .on() or is it something else?
> if (((test>=0) && (test<=90)) || ((test>270) && (test<=360))){n_y=1;}
> else {n_y=-1;}
I need the magnitude of trigonometric function in order to determine the sign of the trigonometric function for an angle falling into a particular quadrant.
My plan is to replace the code above with something equivalent.
Here is what I want to do in pseudo-code.
n_y = cos(test) / (magnitude of cos (test));
This will give me same thing. Abs() only takes integers. Any help is appreciated.
hi,
how could i set a variable with a submit button in order to differenciate 2 behaviours, so first time the same submit button will insert in database and in second time it updates database values.
Thanks.
I need a little piece of advice.
I have a test page with 2 fields: word number and URL
Also i have a button Push.
When i push the button i want to open the specified URL (it's local html files) and highlight the word at the "word number" position
Of course the code must ignore element nodes (<p>,<b>,<table> and so on)
Already checked exisitng questions for this, but didn't find an exact match.
My aim is to replace characters (like spaces) on a webpage with a small image using css.
Example:
<p><span>This is a text</span></p>
becomes:
<p><span>ThisIMGisIMGaIMGtext</span></p>
(where IMG stands for a visible image (middot-pic for a space f.e.))
I cannot think of a suitable css selector. But myabe one of you guys (or girls) know a solution. Is this possible at all?
Hello all!
I have a small problem on IE browser (actually on Google Chrome too)
I have this js code
function createDoc(url) {
var xhttp = ajaxRequest();
var currentLocationBase = window.location.href;
currentLocationBase = currentLocationBase.substr(0,currentLocationBase.lastIndexOf("/") + 1);
var u = currentLocationBase + url;
xhttp.open("GET", u, false);
xhttp.send(null);
var xml = xhttp.responseXML;
return xml;
}
/**
* Builds an AJAX reques handler.
*
* @return The handler.
*/
function ajaxRequest() {
var xhttp = null;
if (window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
} else if (window.ActiveXObject){
// Internet Explorer 5/6
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
} else {
}
return xhttp;
}
In Firefox this code works great, but not in IE and Google Chrome
Seems that the error is given at the line
xhttp.open("GET", u, false);
Can anyone help me to understand what i'm doing wrong?
Thanks
Hi,
I have a drop down field that if any items of it selected,it would be disabled,after that i submit the form,but then (after submitting) the drop down field dosent have any value, I want to have a value after submit but my drop down field is empty.
Thanks for any help,
(sorry for my English)
Heya,
I have just implemented the excellent jQuery UI autocomplete.
http://jqueryui.com/demos/autocomplete/
There is a strange bug in IE 8 (and maybe other versions).
When you select an item from the box of suggestions in IE 8 the cursor moves to the begining of the textbox before the suggested word which has just been inserted.
Firefox put the cursor after the inserted word.
Does anyone know of a fix for this?
Regards
Steve
Hi friends,
document.getElementById(id).style.display ='table-cell'. This gives error message in IE, this is IE bug or any other solutions please give any other solutions.
IE7 doesn't support this property.
this is my coding. Even Firefox and Chrome are accepted. My problem is IE. Please friends give solution...
var cont2 = document.createElement('div');
cont2.style.display = "table-cell";
cont2.style.verticalAlign = "middle";
cont2.style.lineHeight = 100+"%";
cont2.style.padding = 10+"px";
cont2.appendChild(body);
I'm trying to have the content of the an HTML textbox be selected fully onFocus.
I know the simple solution of putting a onfocus="this.select()" on the component but this is not a good solution because if a user double clicks into the area the selection is lost and in browsers like chrome it is rarely working like it should and just reverts into input form.
I have searched on Google for a little while and can't find a good solution, most suggestions are of this simple solution.
What I would like it is that the selection inside the textbox not change once selected and if possible the user should not be able to edit the content of the textbox, for example if you have used AdSense when you grab code from AdSense the selection never changes and your unable to alter the code in the textbox.
Any solutions would be appreciated.
After performing an ajax request if the input in the form was wrong I am trying to get this validatationTextBox to be focussed on and display an indicator message showing the problem.
The code is:
dijit.byId("passwordField").focusNode.focus()
The form element is as mentioned a validationTextBox.
The matter that is confusing me even further is that before in dojo 1.5, this piece of code was simply dijit.byId("passwordField").focus() and this worked fine. How can I fix this?
{"paging": {"pageNum":2,"action":"Next","type":"","availableCacheName":"getAllFunds","selectedCacheName":"","showFrom":101,"showTo":200,"totalRec":289,"pageSize":100},
"Data":[{"sourceCodeId":0,"radio_fund":"individua
l","availableFunds":[],"fundId":288,"searchName":[],"fundName":"Asian Equity Fund A Class Income","srcFundGrpId":"PGI","firstElement":0,"las
tElement":0,"totalElements":0,"pageList":[],"standardExtract":true}]
I have json file with above format with two fileds,one paging and one is Data array.
I able to retrieve values of paging,but i am not able to retrieve the values of data array with .each function of jquery.
Any suggestions or inputs really appreciated.
I could spike this to find out, but I'm going to use SO. In my unit tests (qunit) I use the asynchShould (alias for asynchTest) test. Part of the assertion is to wait for the completion/success of the request. Like this:
asyncShould('talk to customer list server', 1, function() {
stop(2000);
var forCustomerList = newCustomerListRequest();
forCustomerList.page = 'helpers/helper.php';
forCustomerList.data += '&action=customerListServer&DB=11001';
var originalSuccess = forCustomerList.success;
forCustomerList.success = function(msg) {
if (msg.flash !== undefined && msg.data !== undefined && msg.status !== undefined) {
ok(true, 'json structure correct')
}
else {
ok(false, 'json structure not correct');
}
originalSuccess(msg);
start();
};
testController.getServerData(forCustomerList);
})
I got a simple form and it works fine in ie but not working in firefox
onclick="login('loginuser','../private/loginuser.php?username='+email.value+'&pass='+passw.value,'loginresult');"
Any help appreciated.
How to add "Back to top" link at bottom at is browser window is shorter than page, using jquery?
<div id="mainContent">
<p>Some content</p>
</div>
If some content is bigger than browser window ( I mean if vertical bar comes on the page)
then i want to add Back to top just before closing the div.
<div id="mainContent">
<p>Some content</p>
<p>Some content</p>
<p>Some content</p>
<a href="#"> Back to top </a>
</div>
Hi All,
i am using two frames in a page. Mainframe have a page with text box to get input and gives the result url.
Needs:
I want to show this page in the topframe.
I want to set focus to the text box control in the mainframe always. using the following code but giving null error.
parent.frames['mainFrame'].document.getElementById('form1:txtbox').focus();
<frameset rows="550,0" cols="1008" frameborder="NO" border="0" framespacing="0">
<frame src="" id="topFrame" target="topFrame" runat="server" scrolling="no"></frame>
<frame src="Search.aspx" runat="server" id="mainFrame"></frame>
</frameset>
I am writing a Firefox Add-On that currently is depending on jQuery for the following things:
Selectors
Animations
A special .live("focus") hail-mary event-catching maneuver that happens to work with jQuery 1.4.2 (but not 1.4.4)
jQuery isn't well suited for functioning inside XUL, and it's a miracle we've gotten this far with it. We're trying to remove the jQuery requirements, the first two are easy (animations are simple, and we can use .querySelector() instead of jQuery), but the .live has proven impossible to do on our own. I've tried reading the source code, but I haven't been able to piece it apart.
What is the jQuery .live function doing? There's clearly a lot more going on than document.addEventListener("focus"/"focusin",function_to_pick_apart_events). What else is going on here?
IF both methods are declared as virtual, shouldn't both instances of Method1() that are called be the derived class's Method1()?
I am seeing BASE then DERIVED called each time. I am doing some review for an interview and I want to make sure I have this straight. xD
class BaseClass
{
public:
virtual void Method1() { cout << "Method 1 BASE" << endl; }
};
class DerClass: public BaseClass
{
public:
virtual void Method1() { cout << "Method 1 DERVIED" << endl; }
};
DerClass myClass;
((BaseClass)myClass).Method1();
myClass.Method1();
Method 1 BASE
Method 1 DERVIED
var os = $.client.os; // mac
var browser = $.client.browser; // firefox
var browserversion = $.client.browserversion; // 3
$('#root').addClass( os + browser + browserversion );
.. results in <div id="root" class="macfirefox3">. How do I add spaces between them?
i'm trying to find table sorting and paginating script, and i've found a good one, but there is some problem i can't understand anyway.
look at demo please
the pagination must be in the center, but in IE it on the left side.
i've download the script and try to correct it, but i can't.
maybe you can understand what is the problem, or maybe can give the link on another such script, which works on all browsers.
thanks
sub items of dropdown can be increased and decreased. angle only needed at last item's right bottom corner.
Edit:
I Know how to make dropdown menu and how to give cross browser transparency , my question is about to make transparent dropdown with right bottom angle.