w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Passing Map Location information from PHP to javascript for use with Google maps v3 api
Get the values from DB, by using PHP while loop and store the values in a variable as below $location .= '['. $row['latitude'] . ',' . $row['longitude'] . ',"' . $row['city'] . '","' . $row['state'] . '"],' ; In Javascript, assign the PHP variable to a Javascript variable as below. var locations = [<?php echo isset($location)?$location:''; ?>]; var len = locations.length; for (i = 0; i < len; i++) { var image = 'GIVE HERE THE PATH OF IMAGE'; marker = new google.maps.Marker({ position: new google.maps.LatLng(locations[i][1], locations[i][2]), map: map, icon: image }); google.maps.event.addListener(marker, 'mouseover', (function(marker, i) { return function() { infowindow.setContent(content); infowindow.open(map, marker);

Categories : PHP

Passing information to another GSP
Instead of doing a forward from controller, you could use render(view:"confirm") at the same line. Your data in params map will be available in the confirm.gsp page.

Categories : Grails

Display wrong information with the good row value
you have missed </td> in your code. and use echo $dnn['TitreEvent']; without parenthesis try this <td class="left"><h1><?php echo $dnn['TitreEvent']; ?></h1> Email: <?php echo htmlentities($dnn['DescriptionEvent']); ?><br /> <a href=*****.php>Retour.</a> </td> ^^----you missed this EDIT: Ithink you have many result returned from your sql and you need to specify more in your query . like that where MomentEvent=$MomentEvent AND user = $theUser

Categories : PHP

Passing around information via JSF FacesContexts
You could enclose a <f:attribute> tag inside your input component and then retrieve the attribute value inside the validator via FacesContext.getCurrentInstance().getAttributes().get(attrname); Syntax for the tag should be <f:attribute name="attrname" value="#{ELexpr}"> Here's a semi complete example validator: public class NameValidator implements Validator { @Override public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException { Object value = (String)component.getAttributes().get("FIELD_NAME"); // validate stuff } } and corresponding jsf <h:inputText id="name" value="#{registrationManager.name}"> <f:validator validatorId="nameValidator" /> <f:attribute name="FIELD_NAME" va

Categories : JSF

Passing the property from controller to view not working? or am I passing wrong property?
if you want the proper item with an Id = some id to display, you need to select the record by Id. in your code, add a where clause to your linq select statment, it could be... var module = (SbSis.Modules.Where(t => t.ID == id).Select( ....

Categories : Asp Net Mvc

Why does Codeigniter set_flashdata() insert wrong information?
Your flashdata has not been updated until you 'redirect' back to another page. So your $this->session->flashdata('prev_page') is your LAST page before the redirect. The docs specifically state: CodeIgniter supports "flashdata", or session data that will only be available for the next server request, and are then automatically cleared

Categories : PHP

I want to add information into the contact according to the ID number, but it always being added to the wrong name.
The answer here may help: Inserting contacts in Android 2.2. It seems the code above does not work on all devices as per the comments there. The answer posted by Alok Save http://stackoverflow.com/users/452307/alok-save, suggests using the applyBatch() method as follows: ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>(); int rawContactInsertIndex = ops.size(); ops.add(ContentProviderOperation.newInsert(RawContacts.CONTENT_URI) .withValue(RawContacts.ACCOUNT_TYPE, null) .withValue(RawContacts.ACCOUNT_NAME,null ) .build()); ops.add(ContentProviderOperation.newInsert(ContactsContract.Data.CONTENT_URI) .withValueBackReference(ContactsContract.Data.RAW_CONTACT_ID, rawContactInsertIndex) .withValue(Data.MIMETYPE,Phone.CONTENT_IT

Categories : Java

Passing information between multiple activities
Here is roughly what your code is doing: Activity 1: Start with no extras Create and save extra called "name" Activity 2: Read name out of extras create and save extra called "current" save the value of name Activity 3: Read the whole bundle of extras Create and save extra called "goal" //Do nothing with the whole bundle Activity 4: Read the whole bundle of extras Inside of Activity 3 you are pulling the values out of extras but not "re-saving" them so that they get passed along to the final activity. So when you get to activity4 the only extra that you should have is "goal" because that is the only one that you added at the end of Activity3.

Categories : Android

Passing form information in a for-loop
You're using the same parameter name over and over again (name=titel - you had a type and probably meant to write as 'title') so when the form submits - only one value will be passed. You can easily fix that by passing the parameters as: ... echo "<tr><td width='150'> <input type='text' name='titel$i' value='$titel[$i]' /> </td></tr> <tr><td><input type='submit' name='submitreg' value='Toon activiteit'/> </td></tr>"; ... and reading it on the other side as title0, title1 etc.

Categories : PHP

Information Passing between Android Activities
That really depends on your needs and how much information. If there is very little information (maybe 2 or 3 pieces of data) I would say using putExtra() is fine and maybe suggest putting them in a Bundle so you don't have to worry about each extra every Activity. If you are dealing with much more than that then I would suggest adding them to a separate class. IMO, it will be much easier to maintain this way, less chances for syntax errors (such as misspelling a "key" parameter) and more flexible if you decide to use the data in other ways. In my current app, it started out using extras, just a few, then grew into many more. It got unmanageable as the data ended up being passed around and used in so many different classes. I just finished up creating a couple separate classes using stat

Categories : Java

Highcharts: passing additional information to a tooltip
I can see it here: tooltip: { formatter: function() { var s = ""; console.log(this.points[0].point.nameList); // ["name1", "name2"] $.each(this.points, function(i, point) { s += point.point.nameList; }); return s; }, shared: true }

Categories : Javascript

Ruby on rails passing information from session into db
You can have the current_user (for example) method: def current_user @current_user ||= User.find_by_id(session[:user_id]) end If you already have this, you can create post with: @post = current_user.posts.create(params[:post]) You should also check, of course, if any user is signed in before creating post, or you'll have NoMethodError.

Categories : Ruby On Rails

Passing information between HTML 5 Video and form textarea
This fiddle should get you headed in the right direction. http://jsfiddle.net/3n1gm4/kLWL4/ JS: (function() { var theText = document.getElementById('text1'); var theVideo = document.getElementById('video1'); theText.addEventListener('focus', function(e) { curTime = theVideo.currentTime; curSecs = Math.floor((curTime % 60)); curTimeText = " " + Math.floor( curTime / 60 ) + ":" + ((curSecs < 10)?'0'+curSecs:curSecs); theText.value = theText.value + curTimeText; }); })(); HTML: <video width="100%" controls id="video1"> <source type="video/mp4" src=""> </video> <textarea id="text1" cols="20" rows="10"></textarea>

Categories : Javascript

Passing information from a widget module to the main window
The question is a little bit nebulous, if only because you will have to make some design decisions about how the user will interact with the GUI. A first attempt might involve some of these things: 1) Add a signal to your widget, have it set its own name. When it changes its name, also emit a signal of the new name. class testWidget(QtGui.QLabel): textChanged = QtCore.pyqtSignal(object) def open(self): fileName = QtGui.QFileDialog.getOpenFileName(self, "Open File", QtCore.QDir.currentPath()) if fileName.isNull(): QtGui.QMessageBox.information(self, "test project", "Cannot load %s." % fileName) self.setText(fileName) self.textChanged.emit(fileName

Categories : Python

A reliable way of sorting an array and passing that information to a view
Your double-loop preserves the order of paintingJobs in customerRecords, though unless you have duplicate customerList ID's, looks somewhat inefficient (why no break?). This means changes to the order of paintingJobs before your double loop will be reflected in customerRecords. Changes after will not. paintingJobs.sort(however); for(var i=0; i<paintingJobs.length; i++) { for(j=0; j<customerList.length; j++) { if (customerList[j].ID == paintingJobs[i].CustomerID) { customerRecords.push(customerList[j]); break; // next paintingJob } } } It looks like the items in customerList are Objects, so if you make a change to an Object in customerList, this change will also appear in customerRecords even after your double loop.

Categories : Javascript

Django - passing user related information to many views
You can use a context processor to add data to the template context in a DRY way. In a nutshell, a context processor is simply a function that accepts a request as its first argument, does some additional processing that you add and augments the context with whatever values you want. You can query an objects models, add the current datetime...pretty much anything you can do with Python or Django can go into a context processor.

Categories : Python

Backbone.js destroy not passing model information to server?
The id of your model will be appended to the url when making requests to the server. So the Gets and Puts that are working should be going to: /backbone/notes/4685293923860480 Delete should be going to the same URL, but should not include no information beyond that. You should have enough information on what to delete by the URL that was hit and the method that was used.

Categories : Backbone Js

Android app installer displays wrong information about required disk space
I'm not sure if this will work: Try restarting your device and then install the app. i was encountering the same problem which got solved by doing the above.

Categories : Android

Range constraint and variable management when passing information from macro to userform to worksheet
I am concerned that the focus might in some (unknown) circumstance shift to another open worksheet and the text will be pasted where it does not belong. Not really sure what you are asking. But you can further define your range variable by using: Workbooks("Book1.xlsm").Worksheets("Sheet1").Range("B7").Value = strValue or Workbooks(wkbSaba).Worksheets(shtCourse).Range("B7").Value = strValue That will ensure it goes to the right workbook and worksheet. I'm not sure why you think you need public variables? EDIT: UserForm Code: Private wsSheet As Worksheet Property Let SetWorksheet(wsSheetPass As Worksheet) Set wsSheet = wsSheetPass End Property Private Sub cmdOK_Click() Dim strValue As String strValue = CourseDescription.Value If strValue <> ""

Categories : Excel

Getting wrong answer from MediaWiki engine when passing Hebrew paramaters
Try String title = "THE_HEBREW_TITLE"; String encodedTitle = URLEncoder.encode(title , "UTF-8"); and use encodedTitle to compose the URL you are using to query the web service.

Categories : Java

Passing complex data directly between Fragments?What's wrong with the code?
You can't pass data directly between 2 fragments. Instead you have to pass data from your fragment 1 to your activity through an interface that you must have previously created. Then, inside the implemented method in your activity, you should retrieve the object reference to fragment 2 and call a public method that you created and do the job. There is a good tutorial in Android official documentation: Android Fragments

Categories : Android

Passing value input by user to another html page using javascript and redirect using javascript function
For this kind of stuff you have to use a server-side language (PHP, ASP, etc.) as you can pass variables thru files and so forth. Doing this with HTML/JS only is going to get you in trouble as you are basically giving the user, pass and id to anyone openly. Have a look here: PHP Codecademy.com

Categories : Javascript

passing javascript variable to ruby function call in javascript HAML
Ruby executes on the server side, javascript executes on the client side. The reason this is working now is that the ruby code is executed when the page is loaded. It is not possible to "pass a javascript variable to ruby" without making an AJAX request to the server.

Categories : Javascript

Passing a javascript variable in an html table to a javascript function
Yes, one way to do so would be this: table.append('<tr><td>'+ fn+'</td><td>'+ ln+'</td><td><button onClick="myFunc("' + fn + '")">Add</button></td></tr>')

Categories : Javascript

passing JSTL to a Javascript function using a third javascript file
You can create object like messageMap in jsp. And create key in this object assign value ${data}. In your jsp: messageMap = messageMap || {} messageMap.Key = ${data} In your javascript file can get the element and append it content to that element: $('.element').html(messageMap.Key)

Categories : Javascript

Get information about the Visitor (Javascript / PHP)
If you would like to Geo Locate your visitors, and discover their physical location based off their IP, MaxMind has a great service with a free option. http://www.maxmind.com/en/geolocation_landing

Categories : PHP

Send information from the WCF to JavaScript
SignalR is a good way to do it, you can see this in detail in the following question: Use SignalR to notify from wcf to JS

Categories : Javascript

Passing information from form to form in MS Access
I would do it in VBA. Run the Append query via code, and then open that table and do a MoveLast. You can grab the ID of the last record that matches your student. You can't get the ID of a record until the record is written, so I think that's the only way to do it.

Categories : Ms Access

How to access html information that is generated by javascript?
Selenium is probably what you're looking for; it's a browser automation framework. You can use Python but Selenium actually uses Firefox to parse a site's content (last time I heard). You can get the python version here but there are other options.

Categories : Java

Look for in Mysql table and pass information from the javascript
What you are doing now is pretty much the standard. If you dont want to use this method then I suggest that you look into session. On your first page you will need to include the line: <?php session_start(); then your normal code. Once you have read the information from the database then place the values into session variables; $_SESSSION['var1'] = $result['id']; //--- continue for all the values you want to save On the second page you will need to do the reverse <?php session_start(); $id = $_SESSION['var1'];

Categories : PHP

How to get Device Information Using HTML5 Javascript & Phonegap
Although I never worked on such area. But what I can suggest is- You will need to write android native plugin to achieve the same. I think there should be android api to read memoryinfo and cpuinfo file if not you can directly read /proc/cpuinfo and /proc/memoryinfo to get ram and cpu related information. Hope it will give you some insight. Below is the link of related question - Android How do you get total memory RAM in the device?

Categories : Javascript

When I click on the button show more information in the same page javascript
You can use JQuery which is a really nice framework to make the coding easy! You want to use the .click() event and the .show() function So you could have something like this $("#clickme").click(function() { $("#hidden").show(); }); and for your html <html> <body> <p id="clickme">Read More</p> <p id="hidden" hidden>COOL STORY BRO</p> </body> </html> Example

Categories : Javascript

JavaScript Date format conversion using locale information
use toLocaleDateString var date = new Date(Date.UTC(2012, 11, 11, 3, 0, 0)); date.toLocaleDateString('en-GB'); // "11/12/2012" date.toLocaleDateString('en-US'); // "12/11/2012"

Categories : Javascript

How to use this dictionary to show the file information in template in javascript?
Use ajax call : say your ajax_template.html : {% for choice in overview %} <tr> <td><input type="checkbox" name="choice_stop" id="choice{{ forloop.counter }}" value="{{ choice.id }}" onchange="checkChecked_stop()"/></td> <td><label for="choice{{ forloop.counter }}">{{ choice.name }}</label></td> <td>{{ choice.source }}</td> <td><div id="remPercentage{{ forloop.counter }}"></div></td> <td>{{ choice.start_date }}</td> <td><div id="remTime{{ forloop.counter }}"></div></td> <td>{{ choice.human_size }}</td> <td><input type="checkbox" disabled {{ choice.flag_email }} /></td>

Categories : Javascript

JavaScript to store jquery result set information in an array
you can use $.each to iterate over the elements. var arr = []; $('.option').each(function() { arr.push( $(this).text() ); }); console.log(arr.join()); Check Fiddle You can also use the .map method var arr = $('.option').map(function () { return this.innerHTML }).get().join(); console.log(arr);

Categories : Javascript

Event object in Javascript, trouble finding information
Official W3c reccomendation clientX and clientY are the official event property handlers you are looking for. Although you might want to consider screenX and screenY too. Events (API) Events Creating, triggering events Event handlers Orientation and motion data Window Event X and Y property Explanation event.x and event.y, what are those? First of all, the x and y properties are not in all events. It is relative on the event triggered. Here is an example: document.body.onclick = function(){console.log(window.event.x)}; If you paste and execute that code in your browser's console, it will log you the x position of the cursor each time you click. Although taking a look at this example: document.body.onkeyup = function(){console.log(window.event.x)}; The console will

Categories : Javascript

How to read the information in configuration files(.properties) in JavaScript?
It is not advisable to read configuration files from JavaScript. Instead you could do this: Read the file on server-side (using PHP, .Net or Python or any other language that you prefer) Render the valid values to JavaScript. Something like: var maxTime = "<?php echo maxTime; ?>"; var upVotePostMaxTime = "<?php echo upVotePostMaxTime; ?>"; where <?php echo maxTime; ?> and <?php echo upVotePostMaxTime; ?> will have values 60 each. This would show on the client-side as: var maxTime = "60"; var upVotePostMaxTime = "60"; and then you may use it in JavaScript. Values are assigned in double quotes to prevent breaking of JavaScript code in case null values are sent from the server. Please ensure that proper values are assigned to JavaScript variables.

Categories : Javascript

Wrong collection.length when passing JSON array to Backbone Collection
If you dump one of the items returned by Google Spreadsheets, you will see that the data is nested in multiple objects, something like this { "id":{"$t":"https://spreadsheets.google.com/feeds/list/..."}, "updated":{"$t":"2013-07-30T12:01:24.000Z"}, "category":[{"scheme":"...","term":"..."}], "title":{"type":"text","$t":"ACIW"}, "content":{}, "link":[{"rel":"self","type":"application/atom+xml","href":"..."}] } In a Fiddle http://jsfiddle.net/nikoshr/kHBvY/ Note how the id property is wrapped in an object "id":{"$t":"https://spreadsheets.google.com/feeds/list/0AjbU8ta9j916dFdjSVg3YkNPUUJnWkZSWjBDWmZab3c/1/public/basic/cokwr"} Backbone collections don't allow duplicates and duplicates are determined based on their id. All your items are considered duplicates and

Categories : Javascript

Iterating through a javascript object and outputting certain information based upon criteria
use a simple template and loop though each item to generate your output: var data=[ { "SeatId": "29A", "passengerName": "Mr test1 test1", "sectorSequence": 1 }, { "SeatId": "22A", "passengerName": "Mr test1 test1", "sectorSequence": 2 }, { "SeatId": "29B", "passengerName": "Mrs test2 test2", "sectorSequence": 1 } ] function template(ob, str){ return str.replace(/{([ws.$]+?)}/g, function(j,a){ return ob[a]||""; } ); } strTemplate="First {passengerName} {sectorSequence} + {SeatId}"; out=$(data).map(function(i,item){ return template(item, strTemplate)}).toArray().join(" "); alert(out); /* result: First Mr test1 test1 1 + 29A First Mr test1 test1 2 + 22A First Mrs test2 test2 1

Categories : Javascript

use css property content on element to exceptionnaly store information for javascript
The css 'content' property is only valid on pseudo elements: https://developer.mozilla.org/en-US/docs/Web/CSS/content As much as this seems like a cool idea, I wouldn't feel comfortable using it in production. I think that you should accept that your js variables and css variables will be in 2 different files and then just apply the values via data-attributes. However, if you really want a creative way to do this only from the css files that can print to the html and thus interact with the javascript, what about using valid properties that will not affect the design? All you are really doing is storing a string in the html, so you could use a rather obscure element such as counter-reset, and then grab the value via jquery.css() variables.less: @bkpoint = 500; css: #any-div { counter

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.