Profile cover photo
Profile photo
Arun Kumar
131 followers
131 followers
About
Arun's posts

I'm playing with the google maps places API. Where should I place the .getPlace() method? It is getting executed even without calling the changeplace function and showing an error in the console.

On a side note, my app has multiple search boxes and their indexes are represented by variable j.

console output:

undefined
undefined
"error"
"Script error. (line 0)
-----------------------------------------------------------
code:

function changeplace(j)
{
places[j] = autocomplete[j].getPlace();
console.log(places[j]);
{


Post has attachment
Photo

Where should I place the .getPlace() method? It is executing even without calling the changeplace function and showing an error in the console.

On a side note, my app has multiple search boxes and their indexes are represented by variable j.

console output:

undefined
undefined
"error"
"Script error. (line 0)
-----------------------------------------------------------
code:

function changeplace(j){
places[j] = autocomplete[j].getPlace();
console.log(places[j]);

I'm trying to clone, set div id and insert ad DIV element using the below code. However the click event isn't inherited by the inserted elements. Any idea on why this is happening and how do i make the inserted divs inherit the click event.

<div id = place2 >
Arrival: <input type="datetime-local" name="bdaytime">
<input id="searchTextField2" class = "location" type="text" size="50"> <br>
Departure: <input type="datetime-local" name="bdaytime">
<input type="radio" name="travelby" value="train" > Train
<input type="radio" name="travelby" value="flight" checked> Flight
<input type="radio" name="travelby" value="road"> Road
<button class = "clone">
</div>



$(".clone").on("click", "button", clonePlace);
function clonePlace()
{
i++;
previd = $(this).parent("div").attr("id");
test = $("#"+ previd).clone();
test.attr("id", "place"+i);
$("#"+previd).after(test);
}

How to set the multiple inputs type textfields to autocomplete using google maps places api. I had tried the below but it isn't working.

var locations = document.getElementsByClassName('location');
var autocomplete = new google.maps.places.Autocomplete(locations);

Thanks,
Arun

In A* search path finding algorithm is the g cost the distance between the current point and it's neighbours?

Post has attachment
I'm running bitnami wordpress instance but it's taking very long time to load the website. I ran the top command but couldn't find anything abnormal. Any idea on why it's taking long time load. Because of this I'm unable to login and update the wordpress.
Photo
Photo
22/02/2017
2 Photos - View album

How do I convert a unix time (epoch time) format to local time in human readable format HH:MM:SS dd:mm:yyyy using the datediff function.

Unfortunately From Unix_time() isn't supported in my querying tool or the the sql server.

How to detect esc key press in an else if condition? Below is the scenario in which I need to detect the keypress.

If (l=1)
{
....................
}

else if (l>1)
{
.......
}

else if (key=esc)
{
return;
}

Post has attachment
How to do draw a orthogonal line between two points. For example x1, y1 and x2 ,y2 are two points in a graph. What is the logic or algorithm to draw the red line shown the pic. Also the logic should be applicate even if the x2, y2 is anywhere on graph.
Photo
Wait while more posts are being loaded