Posts

jquery - Input field value's length -

is there way jquery find out width of text inserted in input field of type text? need info because need perform work when achieved. helpful me find jquery event occurring when user entering 1 more character in input field make first character of whole value invisible? please see example http://jsfiddle.net/j58ht/2/ <input style="width: 35px;" type="text"> <span></span> $('input').on('keyup',function(){ var input = $(this); input.next("span").text(input.val().length + " chars"); }); try entering characters 123456 in input field. when entering char 6 first char 1 invisible. i need event, when value overlaps input. you can find length of value using jquery's val() method returns current value of form element string. can use length property string. $('input').on('keyup',function(){ alert('this length ' + $(this).val().length); }); here...

java - Google App Engine Datastore too slow persistence -

i'm developing gae/j app using jdo manage datastore. offers number of endpoints interact data , on. i'm developing javascript client endpoints. situation: first have endpoint method token getsessiontoken(user usr) , generates session token, assigns user , stores both user , session token in datastore. then have endpoint method info getinfo(token token) receives session token, checks if session token corresponds user , if so, returns info. problem from javascript client, call first method , fine. call second method retreved session token, , receive error saying session token doesn't correspond user... i've checked , realised error happens because new session token has not been persisted yet! question my current solution make javascript client call second method once, , if receives error, wait while , call again... there better solution? edit: this code invloved in first method call idea why takes long... endpoint: @apimethod( name =...

jquery - Rails 3.2: Why does will_paginate page link disapear after first click -

i'm trying implement jquery ajax rails app , far it's working, there bug unable wrap head around. basically, have books page lists books using will_paginate group them in pages of 5 each. my index.html.erb file books view has snippet of code: <div id="page_paginate"> <%= will_paginate @books %><br /> <%= render @books %> </div> the @books partial saved _book.html.erb , looks this: <div class="books_box"> <h1><%= book.title%><span>(<%=link_to book.author.name, book.author%>)</span></h1> <img alt="image" src="<%= book.image_url %>"> <div class="book_info"> <div class="detail_button"><%= link_to "details", '#' %></div> <div class="like_button"><%= link_to "like", '#' %></div> </div ...

PHP XML error parsing SOAP payload on line 3: Reserved XML Name -

this question has answer here: xml error parsing soap payload: reserved xml name 3 answers i'm quite new webservices , soap, , followed tutorial , came code: soap server : <?php include("lib/nusoap.php"); include("getdb.php"); function getusers() { $user_id = $_get['user_id']; $result = mysql_query("select * -table name- user_id = '$user_id'"); $try = mysql_fetch_array($result); return join(",", array( $result['username'], $result['password'] )); } $server = new soap_server(); $server->register("getusers"); $server->service($http_raw_post_data); ?> soap client : <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html> <head> ...

java - Change marker color in Google Maps V2 -

i'm trying change color of marker. i have this: private void addmarker(googlemap map, double lat, double lon, int title, int snippet) { map.addmarker(new markeroptions().position(new latlng(lat, lon)) .title(getstring(title)) .snippet(getstring(snippet))); and add marker: addmarker(map, 40.748963847316034, -73.96807193756104, r.string.title, r.string.snippet); i want change color of marker , thought easy , implement this: private void addmarker(googlemap map, double lat, double lon, int title, int snippet, int icon) { map.addmarker(new markeroptions().position(new latlng(lat, lon)) .title(getstring(title)) .snippet(getstring(snippet)) .icon(bitmapdescriptorfactory.defaultmarker(bitmapdescriptorfactory.(getst...

ruby on rails - I18n strange behaviour -

i using i18n redis store, , have strange behavior after updating rails 3.2.13 [6] pry(main)> i18n.t("my_website_field") => "m" [7] pry(main)> $redis.get("en.my_website_field") => "\"my website\"" i getting first letters of translations to knowledge believe redis-store has issues versions of rails (3.2.13 happens 1 of those). since curious why happening opened github change log , took @ logic changed in 3.2.12 -> 3.2.13 update. the main change noticed dependency chain in activesupport i18n. code changed from s.add_dependency('i18n', '~> 0.6') to s.add_dependency('i18n', '= 0.6.1') the other changes (from changelog): add i18n scope `distance_of_time_in_words so if had take educated guess forcing of use of i18n 0.6.1 created type of conflict redis-store. note: i continue issue change logs i18n , post if have more information on subject. can't...

Liferay JSP is redirecting me to a page i dont want to be redirect -

i developing liferay portlet. portlet pretty done have big issue jsp redirection. every time query successful redirects not jsp want home jsp page. the question how can make redirect me jsp page want? i using liferay sdk eclipse, tomcat 7 , date liferay any appreciated! thanks in advance! from question seems want redirect jsp controller use :- response.setrenderparameter("jsppage", "jsppath"); let me know if have problem !!!