w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Unable to jQuery $.post data to a view in django due to CSRF
Can you try this: $.ajax({ type: "POST", url: '{% url "some_url_which_accepts_post" %}', data: {'csrfmiddlewaretoken': '{{csrf_token}}', 'comment_id':1}, success: function(data, textStatus){ //something }, });

Categories : Django

unable to access xml elements in async class of fragments
Try adding the call to super as the first thing in on PostExecute: @Override protected void onPostExecute(String result) { super.onPostExecute(result); pDialog.dismiss(); ... }

Categories : Android

Unable access elements inside Xelement directly
It is necessary to use XmlNamespaceManager. Let's suppose that your xml is in myfile.xml. Name spaces are missing in your code so I used Microsoft ones instead. Dim reader As New XmlTextReader("myfile.xml") Dim doc As New XmlDocument() doc.Load(reader) Dim nsmanager As New XmlNamespaceManager(doc.NameTable) nsmanager.AddNamespace("nc", "www.microsoft.com/books") nsmanager.AddNamespace("default", "www.microsoft.com/store") Dim book as XmlNode Dim root as XmlElement = doc.DocumentElement book = root.SelectSingleNode("//nc:ID", nsmanager) Code is built from MS samples and was never run. Please apologize mistakes. For more information see: Manage Namespaces Using the XmlNamespaceManager XmlNode.SelectSingleNode

Categories : Xml

Unable to access bootstrap 'defines' within View
Well, I feel like a right idiot. The issue was related to CakePHP caching, I use memcache and had broken my PHP installation of memcache (when updating PHP earlier). This was causing CakePHP to fire an error about the caching, then when it tried to display the error in my default.ctp file, it errored again because that file contains a define from bootstrap.php, which must not have loaded due to the cache engine issue.

Categories : Cakephp

Unable to fetch data from a view that accesses data over db link
This sounds like the old problem with granting privileges. For ad hoc DML (select, insert, etc) we can use privileges granted through a role. But to build permanent objects - views, stored procedures, etc - we must have privileges granted to the user directly. So, the most common explanation for the phenomenon you describe is that the tables' owner has granted rights on those tables to a role not to you.

Categories : SQL

Unable to call multiple view from the same controller in CodeIgniter
Your code works as expected for me provided that: there is a view file "views/welcome.php" there is a view file "views/hello.php" Can you verify that HelloWorld::Buzz() is being called? public function Buzz() { die('yes, it works'); } If this function doesn't execute when you go to /localhost/CodeIgniter/HelloWorld/Buzz, can you provide the following: $config['base_url'] (config/config.php) $config['index_page'] config/routes.php contents

Categories : PHP

JQuery: Bind multiple triggers from multiple elements to one event
You can check if an animation is currently running by using: function toggleSearch() { if (!$("#search").is(":animated")) { $("#search").animate({ width: "toggle", opacity: "toggle" }, "slow",function() { $(this).focus(); }); } } $("#searchButton").parent('li').siblings().animate({ width: "toggle", opacity: "toggle" }, "slow"); $("#searchButton").click(toggleSearch); $("#search").blur(toggleSearch); http://jsfiddle.net/hGgc9/3/

Categories : Jquery

Jquery multiple animations multiple elements one onclick function
you need to disable the queue for the animations that shall run at the same time: $('#effect1').click(function() { $(this).finish(); $(this).animate({ right: 200, queue : false }); $('#effect2, #effect3').animate({ left: 1000, queue : false }); }); From the jQuery API Docs: queue (default: true) Type: Boolean or String A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. [Edit] try this: $('#effect1').click(function() { $(this).finish(); var self = this; setTimeout(function(){ $(self).animate({ right: 200, queue : false }) },1); setTimeout(function(){ $('#effect2, #effect3').animate({ left: 1000, queue : false }); },1); });

Categories : Jquery

Access elements of a list using JQuery
Something like that? // Save the return value of the function in a variable var arr = getRandomData(); // Print data to the console console.log(arr) // Print the first dataset console.log(arr[0]) // [0, 29] // Print only the number of the first set console.log(arr[0][1])

Categories : Javascript

In JQuery, how do I access an array of DOM elements?
Use jQuery.each to iterate over the array: $.each(checkedItems, function (idx, ele){ // ele is a reference to the individual element, so: console.log(ele.value); // outputs the value of the checkbox }); Documentation jQuery.each - http://api.jquery.com/jQuery.each/

Categories : Javascript

Access multiple elements of list knowing their index
Alternatives: >>> map(a.__getitem__, b) [1, 5, 5] >>> import operator >>> operator.itemgetter(*b)(a) (1, 5, 5)

Categories : Python

JQuery - Unable to access variables which are returned in json
rows is an array, as well as elements, you need to access it like this: var text = data.rows[0].elements[0].distance.text; // this yields "652 km" You want to return the first element of the array, because it has only one. rows[] doesn't access anything. You need a number within the brackets. There might be multiple objects rows or elements. Fill in the array index you want: var text = data.rows[2].elements[5].distance.text; // this yields text from the sixth element of the third row. Original response: { "destination_addresses" : [ "London, UK" ], "origin_addresses" : [ "Edinburgh, City of Edinburgh, UK" ], "rows" : [ { "elements" : [ { "distance" : { "text" : "652 km", "valu

Categories : Javascript

unable to access asp.net textbox value in jquery modal dialog
Change to this. EDIT: Note the quotes around txt1 in data parameter. $.ajax({ type: "POST", url: "Defacement.aspx.cs/childBind", contentType: "application/json; charset=utf-8", dataType: "json", data: {"txt1:" + $("#test_input").val()}, success: function(){alert("successful" + $('#Content_test_input').val()); } });

Categories : C#

Unable to access multiple nodes of model object in handlebarjs template
You need to change your template name to index to match the route where the data is returned by model hook: // that route belongs to index template Astcart.IndexRoute = Ember.Route.extend({ model: function() { return Astcart.Application.find(); } }); Just change the template to: <script type="text/x-handlebars" data-template-name="index"> And change the mapping of the Astcart.Contents to product_name instead of name. To match with your fixture: Astcart.Contents = Ember.Model.extend({ product_name: Ember.attr() }); Fixtures: ... "contents": [ { "product_name": "abc", }, { "product_name": "pqr", } ] ... Working example http://jsfiddle.net/marciojunior/NKTcc/

Categories : Ember Js

How can I bind multiple elements to multiple events in jQuery?
Try this. $(document).on('click submit', '#regForm, .regDiv', function(e) { //place your code }); .on() should be like .on( events [, selector ] [, data ], handler(eventObject) )

Categories : Javascript

How to send files and data from form with multiple divs and multiple dynamic elements as shown below?
Maybe this way will be better $(document).ready(function() { // submitting $('#upload-form').on('submit', function() { // get values var answer = $("#album_name").val(); // if empty if(answer == '') { alert('write album name'); } else { // ajax $.ajax({ url: $(this).attr('action'), // path for submit (upload.php) type: $(this).attr('method'), // here is post data: $(this).serialize(), // put all values into $_POST success: function(html) { // I get answer from upload.php alert(html); } }); } return false; // for not submitting the form }); });

Categories : PHP

unable to access JSON data in Objective-C
The JSONObjectWithData method has an error parameter, of which you can avail yourself in order to diagnose the problem. For example: NSError *error = nil; NSArray *allData = [NSJSONSerialization JSONObjectWithData:JSONData options:0 error:&error]; if (error) NSLog(@"%s: JSONObjectWithData error: %@", __FUNCTION__, error); In your comments, you suggest that you received an error about "Unescaped control character around character 414." That would suggest an error in the JSON, itself, which you might want to validate by copying into http://jsonlint.com/ and see if it reports any issues. In response to the broader question about whether there are any Objective-C issues, there ar

Categories : Iphone

Unable to access the data in listview from json in android
I have two doubts 1) stations.station_name in holder.name.setText(stations.station_name); doesn't have any value. Please check whether "station_name" is initialized or not? 2) holder.name may be null. Check when you assign convertView.findViewById(R.id.textView_single_item);, textview_single_item is there in your layout.

Categories : Android

Access view like a another View when reuse layout multiple times in single layout
You can add an id to each include like this <include android:id=”@+id/child1” android:layout_width=”match_parent” android:layout_height=”match_parent” layout=”@layout/child”/> <include android:id=”@+id/child2” android:layout_width=”match_parent” android:layout_height=”match_parent” layout=”@layout/child”/> <include android:id=”@+id/child3” android:layout_width=”match_parent” android:layout_height=”match_parent” layout=”@layout/child”/> Then from the Activity you can retrieve each child and its content with: View child1 = findViewById(R.id.child1); Button button1 = child1.findViewById(R.id.someButtonInsideChildLayout); View child2 = findViewB

Categories : Android

how to access the elements which created using the jquery insertAfter method
Just keep track of a reference to the element then... var element; $("#sel").change(function () { var sel = $(this); if(element)//check if an input has already been created element.remove();//remove the old input from the DOM element = $("<input/>").val(sel.val());//create the new input and store the reference element.insertAfter(sel);//insert the new input to the DOM }); $("#sel").change(); Here is a working example Because insertAfter is a function of the element you are creating, you must already be creating a reference to it in your current code anyway. So you just need to store that reference globally. Then each time you change the select, you can check if the reference has a value and remove it from the DOM.

Categories : Javascript

How To Access Dynamically Created Page Elements with jQuery
To make use of event delegation with on() (which replaces live()): $('#table').on('click', 'td button', function(e){ }); Or you could just wrap your html in a jQuery function and bind the events right away (simplified example): var $tr = $('<tr><td>foo</td></tr>').on('click', function(e){ }); $tr.appendTo('#table'); This would obviously bind the event to the actual <tr>, but you get the idea.

Categories : Javascript

Unable to view uploaded timeseries data in UI chart
Is your table type relational or stream? If relational, what is the primary key? If time series, this url will give you the last 10 values because of the parameter 10 and reverse=true. http://[yourhost]/api/firstvaluesV1/10/rawdataV1/[yourtablename]?reverse=true If relational table, you can retreive all values like so http://[yourhost]/api/getdataV1/select+c+from+[yourtablename]+as+c replace either urls [yourhost] and [yourtablename] values. We do not use the tables page much. It is better to click in the specific database as in My Databus -> Databases and then click on the database that has your table. We are about to add a view data link in there showing most recent 1000 values or something like that. There is already a view chart which shows most recent 2 hours(again, we wan

Categories : Misc

CustomCell: unable to show data on main view
You can also try this: Create Class File like this: CustomRankingCell.h #import <UIKit/UIKit.h> @interface CustomRankingCell : UITableViewCell +(UITableViewCell *) cellFromNibNamed:(NSString *)nibName; @end CustomRankingCell.m #import "CustomRankingCell.h" @implementation CustomRankingCell + (CustomRankingCell *)cellFromNibNamed:(NSString *)nibName { NSArray *nibContents = [[NSBundle mainBundle] loadNibNamed:nibName owner:self options:NULL]; NSEnumerator *nibEnumerator = [nibContents objectEnumerator]; CustomRankingCell *xibBasedCell = nil; NSObject* nibItem = nil; while ((nibItem = [nibEnumerator nextObject]) != nil) { if ([nibItem isKindOfClass:[CustomRankingCell class]]) { xibBasedCell = (CustomRankingCell *)nibItem;

Categories : IOS

code executes without error but unable to update Access data using C#
Your "edit" problem stems from the fact that parameterized queries in ACE/Jet OLEDB ignore parameter names and therefore the parameters must be added to the OleDbCommand object in the exact order that they appear in the CommandText. Your INSERT and UPDATE commands use the parameters in a different order, so you must process the com.Parameters.Add statements in a different order depending on whether you are doing an INSERT or an UPDATE ("edit").

Categories : C#

Unable to access names of a data frame inside an R function
doit = function(qs) { print (colnames(qs)) # i expect this to print the column names in my data, but it doesn't return(nrow(qs)," ") # the number of rows does print correctly though } adding print is enough if you want to display some value while function call. if you would like that function returns something, that can be used in some assignment,etc. you need to put return statment.

Categories : R

Unable to access data from Mongodb via express/mongoose/angularjs
You likely will want to add a route specifically for the "news": app.get('/news', function(req, res, next){ News. find(). exec(function(err, nws){ if(err) { res.writeHead(500, err.message) } else { res.send(nws); } }); }); Right now, you've got it returning the basics of a web page (res.render('index', { title: 'static Express' });) and then the response from the find call. Angular won't accept that as a result, and it explains why you're seeing the DOCTYPE in the response. And then call it from your Angular code: var News = $resource('/news');

Categories : Node Js

Android ListView, retrieve specific element(View) from row with multiple elements
I'm not really sure if I understood you, but I think you want to add a AdapterView.OnItemClickListener to your ListView. Implement this listener which only has one method: onItemClick(AdapterView<?> parent, View view, int position, long id) In your case view will be the row the user clicked and item is the position of the row in your adapter. To retrieve the text of the row, first you should get the TextView (if your view is a container) with something like TextView textView = (TextView) view.findViewById(R.id.your_textview_id); and then retrieve the text with a call to textView.getText() Hope it helps

Categories : Android

Unable to access data of nested nodes of model object in template
Your FIXTURES are wrongly nested, you should only have one contents array, resulting in: Astcart.Application.FIXTURES=[ { "home_products": [ { "id": "1", "name": "Mobiles & Accessories", "contents": [ { "id": "1", "product_name": "abc11" }, { "id": "2", "product_name": "abc12" }, { "id": "3", "product_name": "abc21" }, { "id": "4", "product_name": "abc22" }, { "id": "5", "product_name": "abc31"

Categories : Ember Js

Unable to access Method with argument list in View Page defined in Model page in Rails 3
Am I right, that "active" is an attribute of user? If yes, I would change that to an instance method. Change the line in the view to: doc.activate_doctor And in the model def activate_doctor self.active = 1 # if the colum is an integer self.active = true # if the column is a boolean self.update_attribute(active, 1) # if you want to update the value directly end

Categories : Ruby On Rails

jquery insertbefore for multiple elements
You can use prependTo $(document).ready(function () { $('li').each(function () { var $this = $(this); $('p.ui-li-aside', $this).prependTo($this); }); }); Check Fiddle

Categories : Jquery

Fade In / Out Multiple Elements Using jQuery.when
You can exploit a feature of jQuery by which an animated jQuery collection will return a "promise of completion" with .promise() : I think this is what you are trying to achieve : $('.next-' + id).fadeOut(500).promise().then(function() { var n = ...; return $('.next-' + n).fadeIn(500).promise(); }).then(function() { ... }); Note that by building a .then() chain in this way, we avoid a "pyramid of doom". Things get a bit trickier if you are using an custom animation queue, but for the standard fx queue (as in this case), everything is made very simple for you.

Categories : Jquery

X and Y Positions of multiple jQuery UI Elements
First of all, Double ID's are not good.. box-1 and box-2 are better: You are matching all elements with class '.posX' etc. Try this: $(document).ready(function() { var a = 3; $('.dragThis').draggable( { start: function(){ $(this).css("z-index", a++); }, drag: function(){ var offset = $(this).offset(); var xPos = offset.left; var yPos = offset.top; $(this).find('.posX').text('x: ' + xPos); $(this).find('.posY').text('y: ' + yPos); } }); $('.dragThis').click(function(){ $(this).addClass('top').removeClass('bottom'); $(this).siblings().removeClass('top').addClass('bottom'); $(this).css("z-index", a++); }); });

Categories : Jquery

How do I use jQuery slideToggle on multiple elements?
There are multiple problems in your code this is a object reference not a string .drawer is a next().next() sibling of the clicked .call elements parent .tile you have to use $('.call').click(function() { $(this).closest('.tile').next().next('.drawer').slideToggle('slow', function() { }); }); Demo: Fiddle

Categories : Javascript

Jquery sum of attr values for multiple elements
You are trying to call a jQuery method on DOM element (this) You need this - total += parseInt(this.name, 10); Or total += parseInt($(this).attr('name'), 10); Demo -----> http://jsfiddle.net/dtt7u/

Categories : Jquery

Jquery matching multiple elements with same id/class
You need to use each() to iterate through the matched element. Instead of using same id for multiple elements use the same class as the id of element is supposed to be unique. To select multiple elements with same class you can use attribute selector like $('[id=container]') but it is better to use class and keep the ids of elements unique. Live Demo function checkads() { $('.someclass').each(function(){ if($(this).height() < 50) { $(this).parent().parent().prepend('<div id="ad-notice">Please support our website</div>'); } }); } $(document).ready(checkads);

Categories : Javascript

Adding multiple elements to DOM before reflow with JQuery
Pull a clone of the parent element into memory, alter it, and write it all back out at once using .replaceWith(): $p = $('#A').parent(); // or select it any way you like $pc = $p.clone(); $pc.find('#A').append('<img src="a.png"/>'); $pc.find('#B').append('<img src="b.png"/>'); $p.replaceWith($pc); http://jsfiddle.net/mblase75/fSnLb/

Categories : Jquery

Run one jQuery function on multiple elements with the same class
Just target that class directly. So for example $(".gallery_background").function() Or, if the function can't be called like that and you want to process each element with something else you could do $(".gallery_background").each(function(index, item){ var elm = $(this); ... Do stuff ... }) I could have got index and item the wrong way round but you get the idea :)

Categories : Javascript

jQuery .click for multiple elements with same class
You probably want to find the .enableUser and .disableUser of the current row. this will refer to the clicked element and from there you can traverse the DOM and find the right elements: jQuery(".disableUser").click(function() { jQuery(this).hide().closest("tr").find(".enableUser").show(); }); Have a look at the documentation for .closest and .find for more information. You might also want to read more about event handling.

Categories : Jquery

Using variables and elements together in jQuery multiple selectors
You need to pass a single selector string: $('#element-A'+idx + ', #element-R'+idx + ', #element-Z'+idx).hide(); Or, better yet, add a common class to all of the elements, and just use that instead.

Categories : Misc

MS MVC (razor) Access view data for serializartion
Use the .serialize() method from jquery: function CreateUser() { var data = $('form').serialize(); $.ajax({ url: '@Url.Action("CreateUser", "User")', data: data, type: "POST", dataType: "json", success: function (data) { $.event.trigger({ type: "CreateUserCompleted", NewUserID: 1, }); } }); } You can instead of using Html.BeginForm use Ajax.BeginForm to not mess with the internals if you are doing the same thing as a the Html.BeginForm without anything special. you could change your code to: @using(Ajax.BeginForm("MyAction", "MyController", new AjaxOptions { HttpMethod = "POST" })) { // Same f

Categories : Asp Net Mvc



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