Search Results

Search found 38817 results on 1553 pages for 'inline function'.

Page 43/1553 | < Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >

  • jquery function problem

    - by user295189
    I have this function function onclickRowRecord(recordID) { $.ajax({ type: "POST", url: '/file/to/post.to.php' , data: {recordID:recordID}, success: function(data) { //how to post this to function howToPost(recordID) the recordID } }); } function howToPost(recordID){ alert(recordID); } so how can I get the response from ajax success and post to the other function

    Read the article

  • ASP.NET/MVC: Inline code

    - by JamesBrownIsDead
    What am I doing wrong? How come <%: this %> isn't being interpreted as C#? Here's the code (ignore the left side): And here is what it renders (notice the Firebug display): What do you think is going on? MVC newb here. :(

    Read the article

  • Why is my javascript function sometimes "not defined"?

    - by harpo
    Problem: I call my javascript function, and sometimes I get the error 'myFunction is not defined'. But it is defined. For example. I'll occasionally get 'copyArray is not defined' even in this example: function copyArray( pa ) { var la = []; for (var i=0; i < pa.length; i++) la.push( pa[i] ); return la; } Function.prototype.bind = function( po ) { var __method = this; var __args = []; // sometimes errors -- in practice I inline the function as a workaround __args = copyArray( arguments ); return function() { /* bind logic omitted for brevity */ } } As you can see, copyArray is defined right there, so this can't be about the order in which script files load. I've been getting this in situations that are harder to work around, where the calling function is located in another file that should be loaded after the called function. But this was the simplest case I could present, and appears to be the same problem. It doesn't happen 100% of the time, so I do suspect some kind of load-timing-related problem. But I have no idea what. @Hojou: That's part of the problem. The function in which I'm now getting this error is itself my addLoadEvent, which is basically a standard version of the common library function. @James: I understand that, and there is no syntax error in the function. When that is the case, the syntax error is reported as well. In this case, I am getting only the 'not defined' error. @David: The script in this case resides in an external file that is referenced using the normal <script src="file.js"></script> method in the page's head section. @Douglas: Interesting idea, but if this were the case, how could we ever call a user-defined function with confidence? In any event, I tried this and it didn't work. @sk: This technique has been tested across browsers and is basically copied from the prototype library.

    Read the article

  • Can I add a function to enums in Java?

    - by Samuel Carrijo
    Hi, I have an enum, which looks like public enum Animal { ELEPHANT, GIRAFFE, TURTLE, SNAKE, FROG } and I want to do something like Animal frog = ANIMAL.FROG; Animal snake = ANIMAL.SNAKE; boolean isFrogAmphibian = frog.isAmphibian(); //true boolean isSnakeAmphibian = snake.isAmphibian(); //false boolean isFrogReptile = frog.isReptile(); //false boolean isSnakeReptile = snake.isReptile(); //true boolean isFrogMammal = frog.isMammal(); //false boolean isSnakeMammal = snake.isMammal(); //false Can I do it in Java?

    Read the article

  • Android change context for findViewById to super from inline class

    - by wuntee
    I am trying to get the value of a EditText in a dialog box. A the "*"'ed line in the following code, the safeNameEditText is null; i am assuming because the 'findVeiwById' is searching on the context of the 'AlertDialog.OnClickListener'; How can I get/change the context of that 'findViewById' call? protected Dialog onCreateDialog(int id) { AlertDialog.Builder builder = new AlertDialog.Builder(this); switch(id){ case DIALOG_NEW_SAFE: builder.setTitle(R.string.news_safe); builder.setIcon(android.R.drawable.ic_menu_add); LayoutInflater factory = LayoutInflater.from(this); View newSafeView = factory.inflate(R.layout.newsafe, null); builder.setView(newSafeView); builder.setPositiveButton(R.string.ok, new AlertDialog.OnClickListener(){ public void onClick(DialogInterface dialog, int which) { * EditText safeNameEditText = (EditText) findViewById(R.id.new_safe_name); String safeName = safeNameEditText.getText().toString(); Log.i(LOG, safeName); setSafeDao(safeName); } }); builder.setNegativeButton(R.string.cancel, new AlertDialog.OnClickListener(){ public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); return(builder.create()); default: return(null); } }

    Read the article

  • Inline comments for bash?

    - by Lajos Nagy
    I'd like to be able to comment out a single flag in a one-line command. Bash only seems to have `from # till end-of-line' comments. I'm looking at tricks like: ls -l $([ ] && -F is turned off) -a /etc It's ugly, but better than nothing. Anybody has any better suggestions?

    Read the article

  • Django-ckeditor inline error

    - by ad3w
    I'm using FeinCMS (https://github.com/feincms/feincms/) and django-ckeditor with file upload support (https://github.com/shaunsephton/django-ckeditor). I create a FeinCMS content type for RichTextField: class RichContent(models.Model): text = RichTextField(_('text')) class Meta: abstract = True verbose_name = _('Rich Text') verbose_name_plural =_('Rich Text') def render(self, **kwargs): context_instance = kwargs.get('context_instance') return render_to_string('content/page/rich_content.html', { 'page': self, }, context_instance=context_instance) But in Django admin, when i select 'Rich Text' and press 'Go', get this error in firebug console: uncaught exception: [CKEDITOR.editor] The instance "id_richcontent_set-__prefix__-text" already exists. And textarea in ckeditor do not editable.

    Read the article

  • Inline instantiation of a constant List

    - by Roflcoptr
    I try to do something like this: public const List<String> METRICS = new List<String>() { SourceFile.LOC, SourceFile.MCCABE, SourceFile.NOM, SourceFile.NOA, SourceFile.FANOUT, SourceFile.FANIN, SourceFile.NOPAR, SourceFile.NDC, SourceFile.CALLS }; But unfortunately this doesn't work: FileStorer.METRICS' is of type 'System.Collections.Generic.List<string>'. A const field of a reference type other than string can only be initialized with null. How can I solve this problem?

    Read the article

  • help with inline images/mail with cron - php?

    - by David Verhulst
    I've got mailings that need to be sended using cron. When I load the script manualy all works fine. With cron i get broken images. to change the src of my img i used: $body = eregi_replace("managersrc_logo","images/managers/acertainlogo.jpg",$body); Because i thaught that it is importent to use absolute paths i also tried: $body = eregi_replace("managersrc_logo","http://www.site.com/images/managers/acertainlogo.jpg",$body); In that case i even do not see the images when i run the cronscript manualy. Nor the automated cron will display me the images. When i check the source of the mail that is received i always see "cid:encryptedstuff" even if i use absolute paths? Why is that? I just want my absolute paths being printed in the src attribute of the img tag. Who changes my absolute path to cid: ? is it php, phpmailer or outlook itself? Any help someone?.... David

    Read the article

  • Good way to handle inline-edit form using Rails and jQuery

    - by Tim Sullivan
    I have a list of items, being displayed in a series of DIVs. When someone clicks on an "edit" link, I want to replace the div with a form that will let them edit the contents of that item in a nice way. I'm trying to think of the ideal way to handle this. Do I create a hidden edit form for every item in the list, and hook the edit link to reveal it, like this: <div> <a href="#">edit</a> Item One <div id="edit_1202" class="editform">Edit form goes here</div> </div> <div> <a href="#">edit</a> Item Two <div id="edit_2318" class="editform">Edit form goes here</div> </div> Or is there a better way to fetch the data and insert the form's HTML into the right spot? Remember, I'm using jQuery, so I can't use the prototype helpers. Thanks!

    Read the article

  • Dynamically bind argument and default value to existing function in Javascript

    - by Scott
    Let's suppose you have some function someFunc() already defined in javascript, that may or may not have its own argument set defined. Is it possible to write another function to add a required argument and set that argument to a default for someFunc()? Something like: var someFunc = function(arg1, arg2 ...){ Do stuff...} var addRequired = function(argName, argValue, fn) { Add the required default arg to a function... } addRequired("x", 20, someFunc); Now someFunc would be defined roughly like so: someFunc = function(x, arg1, arg2...) { x = 20; Do stuff... } What I am really seeking is to not only bind a this value to a function (which I already know how to achieve), but also bind another object reference to that same function (the function not being known ahead of time, as a user will define it, but then the user's code has access to this second object reference for use in their own function). So in my simple example above, the "20" value will actually be an object reference. Thanks for any help you can offer.

    Read the article

  • Javascript Call function serverside

    - by Dusty
    I need to call a Javascript function from the server side in Client side. I looked and didn't find any way how to do it. I looked also over AJAX but can't figure it out. I am using ASP ( clasic) not .net . I need to call the function in client-side with a variable that comes from the client-side. Please help me!!! Thanks a million !!! I am using a FlashMovies that is sending a value to a Javascript function through ExternalInterface class. The function in javascript receiving it is gAnswer(result) and in this function i would need to have something like : Server side: function saveResult(result) {code to be saved on the server goes here } Client side : function gAnswer (result) { saveResult(result) } <- THis is the part i dont know how to do. The function gAnswer is being called when the flash movie finished by itself. Would you be able to provide some code on how to ? thanks to each one of you who helped me =)

    Read the article

  • how do I make a portable isnan/isinf function.

    - by monkeyking
    I've been using isinf,isnan functions on linux platforms which worked perfectly. But this didn't work on osx, so I decided to use std::isinf std::isnan which works on both linux and osx. But the intel compiler doesn't recognize it, and I guess its a bug in the intel compiler according to http://software.intel.com/en-us/forums/showthread.php?t=64188 So now I just want to avoid the hassle and define my own isinf,isnan implementation. Does anyone know how this could be done Thanks edit: I ended up doing this in my sourcecode for making isinf/isnan working #include <iostream> #include <cmath> #ifdef __INTEL_COMPILER #include <mathimf.h> #endif int isnan_local(double x) { #ifdef __INTEL_COMPILER return isnan(x); #else return std::isnan(x); #endif } int isinf_local(double x) { #ifdef __INTEL_COMPILER return isinf(x); #else return std::isinf(x); #endif } int myChk(double a){ std::cerr<<"val is: "<<a <<"\t"; if(isnan_local(a)) std::cerr<<"program says isnan"; if(isinf_local(a)) std::cerr<<"program says isinf"; std::cerr<<"\n"; return 0; } int main(){ double a = 0; myChk(a); myChk(log(a)); myChk(-log(a)); myChk(0/log(a)); myChk(log(a)/log(a)); return 0; }

    Read the article

  • webkit multiple inline shadows

    - by meo
    I have trouble setting multiple shadows on one element in webkit: -moz-box-shadow: inset 0 0 3px #999, 0 0 5px #fff; -webkit-box-shadow: inset 0 0 3px #999, 0 0 5px #fff; box-shadow: inset 0 0 3px #999, 0 0 5px #fff; it works fine in firefox but safari displays only the inset shadow. i tried to set both values separately. But safari takes just count of the last value: -webkit-box-shadow: inset 0 0 3px #999; -webkit-box-shadow: 0 5px #fff; is it possible to set more then one shadow on a single element in safari/webkit?

    Read the article

  • How do I call a basic YUI3 function from within a normal JavaScript function?

    - by Justin Tanner
    I'd like to call a simple YUI3 function from within a JavaScript function. Here is some code that does what I want in a very verbose way: function changeContent (message) { YUI().use("node", function(Y) { Y.all('#content-div').setContent(message); }); } Is there a better way to do this? NOTE: I don't want to attach this function to any event, I just want a global changeContent() function available.

    Read the article

  • Mysql limit function doesn't seem to work for me...

    - by chandru_cp
    Here is my query, select t1.dSyllabus_id,t1.dBatch,t1.dFilePathName, t2.dDegreeName,t3.dDepartmentAbbr from tbl_syllabus as t1 join tbl_degree_master as t2, tbl_department_master as t3 where t2.dDegree_id=t1.dDegree_id and t3.dDepartment_id=t1.dDepartment_id and t1.dCollege_id='1' and t1.dIsDelete='0' and i get applying limit , select t1.dSyllabus_id,t1.dBatch,t1.dFilePathName, t2.dDegreeName,t3.dDepartmentAbbr from tbl_syllabus as t1 join tbl_degree_master as t2, tbl_department_master as t3 where t2.dDegree_id=t1.dDegree_id and t3.dDepartment_id=t1.dDepartment_id and t1.dCollege_id='1' and t1.dIsDelete='0' limit 0,5 i get , I dont get the first five records why?

    Read the article

  • How do I pass custom variables to javascript events?

    - by RoboShop
    I have a user control with a javascript function which references some controls within the user control. This user control works perfectly when there is only one instance of it, but I'm now building a page where I have two instances of the user control. In IE7, it works fine, but in FireFox, it is getting confused that there is two functions of the exact same name and signature. So on UserControl1, it'll be running the function in UserControl2 and modifying that content. I'm thinking my best solution would be to pass the clientID of the components I need TO the function instead of just directly referencing it in the function. How would I do that? The signature of the javascript function is like this function nodeClicking(sender, args) and I'm calling it in an event like this <telerik:RadTreeView runat="server" ID="OrgUnitTreeView" OnInit="TreeViewLoad" OnClientNodeClicking="**nodeClicking**" EnableViewState="true" DataTextField = "OrganisationUnitName" DataValueField = "OrganisationUnitCode" DataFieldParentID = "ParentOrganisationUnitCode" DataFieldID = "OrganisationUnitCode"> How do I add extra variables to the function signature.

    Read the article

  • XmlDeserializer to handle inline lists

    - by d1k_is
    Im looking at implementing a fix in an XmlDeserializer to allow for element lists without a specific containing element. The XmlDeserializer im basing off checks for a list object type but then it gets the container element im trying to figure out how to get around this and make it work both ways. enter code here var t = type.GetGenericArguments()[0]; var list = (IList)Activator.CreateInstance(type); var container = GetElementByName(root, prop.Name.AsNamespaced(Namespace)); var first = container.Elements().FirstOrDefault(); var elements = container.Elements().Where(d => d.Name == first.Name); PopulateListFromElements(t, elements, list); prop.SetValue(x, list, null); The XML im working with is from the google weather API (forecast_conditions elements) <weather module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0"> <forecast_information>...</forecast_information> <current_conditions>...</current_conditions> <forecast_conditions>...</forecast_conditions> <forecast_conditions>...</forecast_conditions> <forecast_conditions>...</forecast_conditions> </weather> EDIT: Im looking at this as an update to the RESTsharp open source .net library

    Read the article

  • Precision of Interval for PL/SQL Function value

    - by Gary
    Generally, when you specify a function the scale/precision/size of the return datatype is undefined. For example, you say FUNCTION show_price RETURN NUMBER or FUNCTION show_name RETURN VARCHAR2. You are not allowed to have FUNCTION show_price RETURN NUMBER(10,2) or FUNCTION show_name RETURN VARCHAR2(20), and the function return value is unrestricted. This is documented functionality. Now, I get an precision error (ORA-01873) if I push 9999 hours (about 400 days) into the following. The limit is because the default days precision is 2 DECLARE v_int INTERVAL DAY (4) TO SECOND(0); FUNCTION hhmm_to_interval return INTERVAL DAY TO SECOND IS v_hhmm INTERVAL DAY (4) TO SECOND(0); BEGIN v_hhmm := to_dsinterval('PT9999H'); RETURN v_hhmm; -- END hhmm_to_interval; BEGIN v_int := hhmm_to_interval; end; / and it won't allow the precision to be specified directly as part of the datatype returned by the function. DECLARE v_int INTERVAL DAY (4) TO SECOND(0); FUNCTION hhmm_to_interval return INTERVAL DAY (4) TO SECOND IS v_hhmm INTERVAL DAY (4) TO SECOND(0); BEGIN v_hhmm := to_dsinterval('PT9999H'); RETURN v_hhmm; -- END hhmm_to_interval; BEGIN v_int := hhmm_to_interval; end; / I can use a SUBTYPE DECLARE subtype t_int is INTERVAL DAY (4) TO SECOND(0); v_int INTERVAL DAY (4) TO SECOND(0); FUNCTION hhmm_to_interval return t_int IS v_hhmm INTERVAL DAY (4) TO SECOND(0); BEGIN v_hhmm := to_dsinterval('PT9999H'); RETURN v_hhmm; -- END hhmm_to_interval; BEGIN v_int := hhmm_to_interval; end; / Any drawbacks to the subtype approach ? Any alternatives (eg some place to change a default precision) ? Working with 10gR2.

    Read the article

< Previous Page | 39 40 41 42 43 44 45 46 47 48 49 50  | Next Page >