Search Results

Search found 2947 results on 118 pages for 'params noob'.

Page 7/118 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • jQuery Flow Control (if then from URL params)

    - by Ryan Max
    Strangely enough I am more familiar with jQuery than I am with javascript. I need to be able to add a class to the body tag of a document depending on what specific forum page i'm on in a phpbb forum. Due to the nature of phpbb I can't actually do this flow control in php, so I am using jquery. Here's my code (the first part is an extend that gets the url parameters like so http://www.mysite.com/viewforum.php?f=3 var forum = $.getUrlVar('f'); will make forum == 3 because of the nature of phpbb i can't really do any flow control with php. So I am using jquery. This is my code: $(document).ready(function(){ $.extend({ getUrlVars: function(){ var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; }, getUrlVar: function(name){ return $.getUrlVars()[name]; } }); }); $(document).ready(function(){ var forum = $.getUrlVar('f'); if (forum == 3){ $('body').toggleClass('black'); } }); Yet this isn't working. Any idea why not?

    Read the article

  • Parse params from an sql query using delphi

    - by Salvador
    How i can parse and extract the parameters from an SQL Query using delphi? example : from this query SELECT * FROM MyTable WHERE Field1=:Param1 AND Field2=:Param2 AND (Field3=:Param3 OR Field4=:Param4) i want to obtain Param1 Param2 Param3 Param4 Thanks in advance.

    Read the article

  • Search by price interval in currency and other params using Searchlogic

    - by alexandr
    Hi I need to reaqlize search in product model with prices in different currencies (price and currecny_id field). Every currency have own rate. When user search for product in price range [x, y] USD, range must be converted to all currencies and return values like (price > from_eur AND price < to_eur AND currecny_id = 1) OR (price > from_aud AND price < to_aud AND currecny_id = 2) How to realize search like this using searchlogic?

    Read the article

  • problems with build params for accepts_nested_attributes_for

    - by holden
    I'm trying to add the user_id to a nested attribute that gets built by a parent controller but it doesn't seem to have the desired effect? Ie. I have a model called Place.rb which accepts_nested_attributes_for :reviews The nested attribute works fine and I build it inside the Places controller like so... @review = @place.reviews.build(:user_id => current_user.id) I was previously adding the user thru the form, but would like to do it thru the controller so that it only adds the user_id on creation, as it might get updated by someone else and i don't want the update changing the user_id... old way which works: <%= e.label :content, "Review" %><br /> <%= e.text_area :content, :rows => 20, :class => 'jquery_ckeditor' %><br /> <%= e.hidden_field :user_id, :value => current_user.id %> but thru the controller the build method with options has no effect? Any ideas? Can I not do this thru the build?

    Read the article

  • Doctrine DQL execute passing params

    - by Karim web Developer
    I used this DQL in Doctrine $q->update('product') ->set('quantity','?') ->where('id=?'); $q->execute(array(20,5)); I check the server for the query and this the generated sql UPDATE product SET quantity = '20', updated_at = '5' WHERE (id = '2010-04-26 14:34); So I need to know why the arguments aren't in the correct places?

    Read the article

  • Rails: link_to with block and GET params?

    - by bobthabuilda
    How can I achieve query string and URL parameters in a link_to block declaration? Right now, I have this, which works: <%= link_to 'Edit', :edit, :type => 'book', :id => book %> The above works, and outputs: http://localhost:3000/books/edit/1?type=book What I want to do is something like this: <% link_to :edit, :type => 'book', :id => book do %> ... <% end %> But the above format outputs: http://localhost:3000/books/edit/ Which isn't what I'm looking for... I want it to output a URL like the previous example. How can I achieve this?

    Read the article

  • executing named_scoped only when there are present params

    - by Luca Romagnoli
    Hi have a model like this: class EventDate < ActiveRecord::Base belongs_to :event named_scope :named, lambda { | name | { :joins => { :event => :core}, :conditions => ["name like ?", "%#{ name }%"] }} named_scope :date_range, lambda { | start, length | { :conditions => ["day >= ? AND day <= ?", start, date + (length || 30) ] }} it works correctly if i launch name = "ba" start = Date.today EventDate.named(name).date_range(start , start + 2) But if the name or the start is nil i don't want execute the named_scope like name = nil EventDate.named(name).date_range(start , start + 2) Is possible to set a condition inner the named_scope ? thanks

    Read the article

  • passing request params from jQuery to jersey service using json

    - by ccduga
    hi, im trying to POST (cross domain) some data to a jersey web service and retrieve a response (a GenericEntity object). The post successfully gets mapped to my jersey endpoint however when i pull the parameters from the request they are empty.. $ .ajax({ type: "POST", dataType: "application/json; charset=utf-8", url: jerseyNewUserUrl+'?jsoncallback=?', data:{'id':id, 'firstname':firstname,'lastname':lastname}, success: function(data, textStatus) { $('#jsonResult').html("some data: " + data.responseMsg); }, error: function ( XMLHttpRequest, textStatus, errorThrown){ alert('error'); } }); this is my jersey endpoint.. @POST @Produces( { "application/x-javascript", MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) @Path("/new") public JSONWithPadding addNewUser(@QueryParam("jsoncallback") @DefaultValue("empty") final String argJsonCallback, @QueryParam("id") final String argID, @QueryParam("firstname") final String argFirstName, @QueryParam("lastname") final String argLastName) is there something missing from my $.ajax call?

    Read the article

  • Perl Hash Slice, Replication x Operator, and sub params

    - by user210757
    Ok, I understand perl hash slices, and the "x" operator in Perl, but can someone explain the following code example from here (slightly simplified)? sub test{ my %hash; @hash{@_} = (undef) x @_; } Example Call to sub: test('one', 'two', 'three'); This line is what throws me: @hash{@_} = (undef) x @_; It is creating a hash where the keys are the parameters to the sub and initializing to undef, so: %hash: 'one' = undef, 'two' = undef, 'three' = undef The rvalue of the x operator should be a number; how is it that @_ is interpreted as the length of the sub's parameter array? I would expect you'd at least have to do this: @hash{@_} = (undef) x length(@_);

    Read the article

  • Can't get a SQL command to recognise the params added

    - by littlechris
    Hi, I've not used basic SQL commands for a while and I'm trying to pass a param to a sproc and the run it. However when I run the code I get a "Not Supplied" error. Code: SqlConnection conn1 = new SqlConnection(DAL.getConnectionStr()); SqlCommand cmd1 = new SqlCommand("SProc_Item_GetByID", conn1); cmd1.Parameters.Add(new SqlParameter("@ID", itemId)); conn1.Open(); cmd1.ExecuteNonQuery(); I'm not really sure why this would fail. Apologies for the basic question, but I'm lost! Thanks in advance.

    Read the article

  • Sending changing params through periodically_call_remote

    - by seaneshbaugh
    I'm using periodically_call_remote to update a portion of a page that contains a list of objects. I send along with the url a param containing the created_at date for the most recent object in the database. The action that is called then get all the objects that have been created since then and renders a partial which displays them at the top of the list. The problem is that I can't seem to figure out how to make it so that the next time periodically_call_remote triggers it sends along the created_at date for the new most recent object (if there is one). I tried putting the periodically_call_remote inside the partial that is being rendered but that caused all sorts of problems (http://www.ruby-forum.com/topic/101614 explains why you shouldn't do that). Is there some way I can make periodically_call_remote send along a new param each time it's called? As it stands right now it just sends the same one over and over which means that new objects get rendered more than once.

    Read the article

  • Sending url params and POST body to a MVC 2 Controller

    - by Luiggi
    Hi, I'm having some issues trying to make a HTTP PUT (or POST) using WebClient against a MVC 2 controller. The exception is: The parameters dictionary contains a null entry for parameter 'total' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult Company(System.Guid, Int32, Int32, System.String)' The controller action is: [HttpPut] public ActionResult Company(Guid uid, int id, int total, string url) The route is: routes.MapRoute( "CompanySet", "job/active/{uid}/company/{id}", new { controller = "Job", action = "Company" } ); As you may see, what I want is to send the 'uid' and 'id' parameters via url, but the 'total' and 'url' parameters as part of the PUT or POST body. I've also tried to merge the latter parameters into a class (i.e., CompanySetMessage), doing it no longer raises an exception but I dont receive the values on the server side. Any ideas? Thank you!

    Read the article

  • SQL IF ELSE with output params stored proc help

    - by Kettenbach
    Hi All, I have a stored proc (SS2008) that takes a couple int ids and needs to look up if they exist in a table before adding a record. I have an int output param I would like to return and set its value based on what occrured. I have this so far, but it always returns 1. Can someone point me in the right direction? BEGIN TRY IF EXISTS ( SELECT * FROM tbMap WHERE (cId= @CId) ) SET @result = -1; -- This C User is already mapped ELSE IF EXISTS ( SELECT * FROM tbMap WHERE (dId = @DId) ) SET @result = -2; -- This D User is already mapped ELSE INSERT INTO tbMap ( Login , Email , UserName , CId , DId) SELECT @UserName , usr.EmailAddress , usr.UserName , @CId , @DId FROM tbUser usr WHERE usr.iUserID = @DId SET @result = 1; RETURN END TRY What am I missing? Thanks for any tips. Cheers, ~ck in San Diego

    Read the article

  • Startup params for Silverlight 4 app

    - by Number8
    Hello -- We are moving our SL3 app to SL4. First step was to open it in VS2010; it converted w/o problem. However, parameters specified for the start page are not passed along. That is, if we specify ourStartPage.aspx?Slam=Dunk&Glass=Sun in app.xaml.cs, Application_Startup(), e.InitParams is empty. How do we fix this? Thanks for any advice.... (Note that the very same startup string worked in VS2008.)

    Read the article

  • Ruby and jQuery -- $(document).ajaxSend() not modifying the params as expected

    - by Jason
    I cannot get jquery's ajaxSend (http://api.jquery.com/ajaxSend/) to properly modify the parameters. I have: $(document).ajaxSend(function(event, request, settings) { settings.data = $.deparam(settings.data); settings.data['random'] = new Date().getTime(); settings.data['_method'] = 'get'; settings.data = $.param(settings.data) $.log(settings); }); $(document).ready(function() { //...snip... $.ajaxSetup({ data : { remote : 1, authenticity_token : encodeURIComponent(AUTH_TOKEN) } }); }); The idea here is that we always want 4 param sent across: remote and auth_token always get set properly. However, random and _method (both needed for IE issues) do not get set. Logging settings inside ajaxSend shows me that they are set to settings.data: "remote=1&authenticity_token=6GA9R_snip_253D&random=1270584905846&_method=get" but when it gets sent across the wire, I only have the following: authenticity_token 6GA9R_snip_253D remote 1 Why in the world is this not working?

    Read the article

  • Can't get a SQlcommand to recognise the params added

    - by littlechris
    Hi, I've not used basic SQLCommands for a while and I'm trying to pass a param to a sproc and the run it. However when I run the code I get a "Not Supplied" error. Code: SqlConnection conn1 = new SqlConnection(DAL.getConnectionStr()); SqlCommand cmd1 = new SqlCommand("SProc_Item_GetByID", conn1); cmd1.Parameters.Add(new SqlParameter("@ID", itemId)); conn1.Open(); cmd1.ExecuteNonQuery(); I'm not really sure why this would fail. Apologies for the basic question, but I'm lost! Thanks in advance.

    Read the article

  • where is POST params for WCF REST

    - by Costa
    Hi Can u put some code sample to get Post parameters sent by client to WCF REST webservice. The request is though a HttpWebRequest. The client will not serialize anything if I will request a certain XML format from PHP programmer, how to make WCF convert this XML to one parameter. currently I am trying to send the request like this and I am stuck HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("http://100.100.1.4000:2805/Something.svc/Bomba/Data.php"); request.ContentType = "text/xml"; request.Method = "POST"; StreamWriter stream = new StreamWriter(request.GetRequestStream()); { stream.Write("FirstName=0&LastName=2"); } request.GetResponse(); stream.Close(); Thanks

    Read the article

  • mod_rewrite params inversion

    - by Fernando Constantino
    How can I create the mod_rewrite rule so I can convert the following URLs: From: domain/something/param/action ex:domain/cities/Chicago/view to: domain/something/action.php?param1=param ex: domain/cities/view.php?city=Chicago Changing to cities/view/Chicago cannot be an alternative. Thanks in advance.

    Read the article

  • Method params match signature, but still getting error

    - by Jason
    I am in the midst of converting a VB library to C#. One of my methods has the following signature in VB: Private Shared Sub FillOrder(ByVal row As DataRowView, ByRef o As Order) In C# I converted it to: private static void FillOrder(DataRowView row, ref Order o) From my constructor inside my Order class, I am calling the FillOrder() method like so: DataView dv = //[get the data] if (dv.Count > 0) { FillOrder(dv[0], this); } In VB, this works: Dim dv As DataView = '[get data]' If dv.Count > 0 Then FillOrder(dv.Item(0), Me) End If However, in VS10 in the C# file I am getting a red squiggle under this call with the following error: The best overloaded method match for [the method] has some invalid arguments This was working code in VB. What am I doing wrong?

    Read the article

  • built in Soap extension php5 passing in params as associative array

    - by Ageis
    I have this xml I'm wanting to pass to this web service function <UserName>myuser</UserName> <Password>password</Password> <User> <AddCoverCode /> <title>sdadasdsa</title> </User> </CreateNewUser>','',array(),'document', 'literal'); I'm using the soap extension buit in php5. Is this what I'm supposed to be passing in the soapcall function as parameters? array('CreateNewUser' => array( 'UserName' => 'sc', 'Password' => 'i82372', 'Registration' => array('username' =>'new','password' =>'ss'));

    Read the article

  • Update Params in Python During Infinite Loop

    - by python Dude
    Hello, I was hoping to get some help on a question. I have an infinite loop that I need run and I need to update a set of variables (x in this case) at random times from the command-line. Is there any way to do this? For example: x = 0 while True: x = x + 1 if x < 30: do something and I need to update x's value from the command-line periodically

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >