Search Results

Search found 2390 results on 96 pages for 'morten green hermansen'.

Page 80/96 | < Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >

  • Dynamically add data stored in php to nested json

    - by HoGo
    I am trying to dynamicaly generate data in json for jQuery gantt chart. I know PHP but am totally green with JavaScript. I have read dozen of solutions on how dynamicaly add data to json, and tried few dozens of combinations and nothing. Here is the json format: var data = [{ name: "Sprint 0", desc: "Analysis", values: [{ from: "/Date(1320192000000)/", to: "/Date(1322401600000)/", label: "Requirement Gathering", customClass: "ganttRed" }] },{ name: " ", desc: "Scoping", values: [{ from: "/Date(1322611200000)/", to: "/Date(1323302400000)/", label: "Scoping", customClass: "ganttRed" }] }, <!-- Somoe more data--> }]; now I have all data in php db result. Here it goes: $rows=$db->fetchAllRows($result); $rowsNum=count($rows); And this is how I wanted to create json out of it: var data=''; <?php foreach ($rows as $row){ ?> data['name']="<?php echo $row['name'];?>"; data['desc']="<?php echo $row['desc'];?>"; data['values'] = {"from" : "/Date(<?php echo $row['from'];?>)/", "to" : "/Date(<?php echo $row['to'];?>)/", "label" : "<?php echo $row['label'];?>", "customClass" : "ganttOrange"}; } However this does not work. I have tried without loop and replacing php variables with plain text just to check, but it did not work either. Displays chart without added items. If I add new item by adding it to the list of values, it works. So there is no problem with the Gantt itself or paths. Based on all above I assume the problem is with adding plain data to json. Can anyone please help me to fix it?

    Read the article

  • How to traverse table in Jquery and add a class?

    - by SWL
    I have a simple table of two rows. The first column is required, but the others are not; however, I would like them to be required in pairs. So if the user enters a value for Quantity3, then Size3 should also now be required. As a fiddle: http://jsfiddle.net/NaRts/7/ <tr> <td><input name="qty1[492]" class="qty required" type="text"></td> <td><input name="qty2[492]" class="qty" type="text"></td> <td><input name="qty3[492]" class="qty" type="text"></td> </tr><tr> <td><input name="size1[492]" type="text" class="size required" ></td> <td><input name="size2[492]" type="text" class="size" ></td> <td><input name="size3[492]" type="text" class="size" ></td> </tr> And the simple jQuery I have is: $('.qty').keyup(function() { var s = $(this).attr('name'); // = qty3[418] var qtyID = s.replace(/[^1-9\[\]]/g, ""); // = 3[418] var SizeID = "size" + qtyID; var $sizeInput = $(this).closest('tr').next().find(SizeID); $sizeInput.css('background-color', 'green'); $sizeInput.addClass('required'); //I tried this too but it didn't work //$(this).parent().find(SizeID).addClass('required'); });? ? Any help is much appreciated.

    Read the article

  • XSLT - How to select top a to top b

    - by user812241
    how can I extract the first 2 C-Values ('Baby' and 'Cola') where B is 'RED'. Input instance is: <Root> <A> <B>BLACK</B> <C>Apple</C> </A> <A> <B>RED</B> <C>Baby</C> </A> <A> <B>GREEN</B> <C>Sun</C> </A> <A> <B>RED</B> <C>Cola</C> </A> <A> <B>RED</B> <C>Mobile</C> </A> </Root> Output instance must be: <Root> <D>Baby</D> <D>Cola</D> </Root> I thought about the combination of for-each and global variables. But in XSLT it is not possible to change the value for a global variable to break the for-each. I have no idea anymore.

    Read the article

  • Linq and returning types

    - by cdotlister
    My GUI is calling a service project that does some linq work, and returns data to my GUI. However, I am battling with the return type of the method. After some reading, I have this as my method: public static IEnumerable GetDetailedAccounts() { IEnumerable accounts = (from a in Db.accounts join i in Db.financial_institution on a.financial_institution.financial_institution_id equals i.financial_institution_id join acct in Db.z_account_type on a.z_account_type.account_type_id equals acct.account_type_id orderby i.name select new {account_id = a.account_id, name = i.name, description = acct.description}); return accounts; } However, my caller is battling a bit. I think I am screwing up the return type, or not handling the caller well, but it's not working as I'd hoped. This is how I am attempting to call the method from my GUI. IEnumerable accounts = Data.AccountService.GetDetailedAccounts(); Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("Accounts:"); Console.ForegroundColor = ConsoleColor.White; foreach (var acc in accounts) { Console.WriteLine(string.Format("{0:00} {1}", acc.account_id, acc.name + " " + acc.description)); } int accountid = WaitForKey(); However, my foreach, and the acc - isn't working. acc doesn't know about the name, description and id that I setup in the method. Am I at least close to being right?

    Read the article

  • Sql Server problems reading columns with a foreigh key

    - by illdev
    I have a weird situation, where simple queries seem to never finish for instance SELECT top 100 ArticleID FROM Article WHERE ProductGroupID=379114 returns immediately SELECT top 1000 ArticleID FROM Article WHERE ProductGroupID=379114 never returns SELECT ArticleID FROM Article WHERE ProductGroupID=379114 never returns SELECT top 1000 ArticleID FROM Article returns immediately by 'returning' I mean 'in query analyzer the green check mark appears and it says "Query executed successfully"'. I sometimes get the rows painted to the grid in qa, but still the query goes on waiting for my client to time out - 'sometimes': SELECT ProductGroupID AS Product23_1_, ArticleID AS ArticleID1_, ArticleID AS ArticleID18_0_, Inventory_Name AS Inventory3_18_0_, Inventory_UnitOfMeasure AS Inventory4_18_0_, BusinessKey AS Business5_18_0_, Name AS Name18_0_, ServesPeople AS ServesPe7_18_0_, InStock AS InStock18_0_, Description AS Descript9_18_0_, Description2 AS Descrip10_18_0_, TechnicalData AS Technic11_18_0_, IsDiscontinued AS IsDisco12_18_0_, Release AS Release18_0_, Classifications AS Classif14_18_0_, DistributorName AS Distrib15_18_0_, DistributorProductCode AS Distrib16_18_0_, Options AS Options18_0_, IsPromoted AS IsPromoted18_0_, IsBulkyFreight AS IsBulky19_18_0_, IsBackOrderOnly AS IsBackO20_18_0_, Price AS Price18_0_, Weight AS Weight18_0_, ProductGroupID AS Product23_18_0_, ConversationID AS Convers24_18_0_, DistributorID AS Distrib25_18_0_, type AS Type18_0_ FROM Article AS articles0_ WHERE (IsDiscontinued = '0') AND (ProductGroupID = 379121) shows this behavior. I have no idea what is going on. Probably select is broken ;) Anyone can tell me how to handle such a situation? More info, anyone?

    Read the article

  • Posting a form using Ajax

    - by hopes
    Hi everyone, do u have an idea of how to send my radio button name for myAjaxPostrequest.send(parameters); can parameters be like this: var answername=document.getElementById('option1').name; var parameters=answername; ? this code is for using ajax to post a form and my php page needs the name of the radiobutton clicked I tried this code and it works as I want except for inserting in the database. It means parameters is the problem what I want to insert is the number located between brakects of the radiobutton name. I could do it when I post form without Ajax but now I can't send the name of the radiobutton any clue about what I can send as parameter for function myAjaxPostrequest.send(parameters);? <form id="Question1" method="post"> <br /> <P> The sky color is.. </P><img border="0" src="images/wonder.png" width="94" height="134"/><br /><br /><br /> <input type="radio" id="option1" name="answer[1]" value="correct!" onclick="submitFormWithAjax();"/> blue <br /> <input type="radio" id="option1" name="answer[1]" value="false!" onclick="submitFormWithAjax();"/> red <br /> <input type="radio" id="option1" name="answer[1]" value="false!" onclick="submitFormWithAjax();"/> green <br /> <input type="radio" id="option1" name="answer[1]" value="false!" onclick="submitFormWithAjax();"/> white <br /> <br /> </Form>

    Read the article

  • HOw to make image stay inside the div box on scrolling

    - by Mirage
    I have the image position fixed inside div and code is gven below #content{ margin-top:100px; width:900px; color:#009; border:1px solid red; overflow:hidden; display:block; } img { float:left; position:fixed; top:140px; padding:50px; } #text{ display:block; border:1px solid green; width:500px; height:1200px; float:right; overflow:scroll; } #footer{ clear:both; width:600px; height:300px; border:2x solid blue; color:#939; } HTML is <div id="content" > <img src="bar.jpg" width="46" height="639" /> <div id="text"> ggggggggggggggggggfgdfgdfgdgdfgdgdfgdf </div> </div> <div id="footer"> Footer text </div> </body> Now when i scroll down then image comes out of the content div box. IS there any way so that even if i scroll the image bar should stay inside the div box. The screen shot shows my problem First Screen is ok without scrolling But when i scroll the text full then it covers my footer as well

    Read the article

  • UINavigationController not working under ARC in iPhone

    - by user1811427
    I have creared a new project "Empty Application" template in Xcode 4.3, it is having only two classes AppDelegate.h & .m I cheaked with ARC to use automatic reference count while creating the app. I added two new files "RootViewController" & "NewProjectViewControllers". I implemented code to set navigation controller as follows in AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. rootViewController = [[MainViewController alloc] init]; UINavigationController *navigation = [[UINavigationController alloc] initWithRootViewController:rootViewController]; [self.window addSubview:navigation.view]; self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; return YES; } and in hte home view (Root view controller) implemented as follows - (void)viewDidLoad { [super viewDidLoad]; self.title = @"Projects"; UINavigationBar *navigationBar = [self.navigationController navigationBar]; [navigationBar setTintColor: [UIColor colorWithRed:10/255.0f green:21/255.0f blue:51/255.0f alpha:1.0f]]; //To set the customised bar item UIButton *rightBarBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [rightBarBtn setBackgroundImage:[UIImage imageNamed:@"plus_new.png"] forState:UIControlStateNormal]; rightBarBtn.frame=CGRectMake(0.0, 100.0, 30.0, 30.0); [rightBarBtn addTarget:self action:@selector(addProject) forControlEvents:UIControlEventTouchUpInside]; UIBarButtonItem* rightBarItem = [[UIBarButtonItem alloc] initWithCustomView:rightBarBtn]; self.navigationItem.rightBarButtonItem = rightBarItem; // Do any additional setup after loading the view from its nib. } - (void) addProject { NewProjViewController *editProject = [[NewProjViewController alloc] init]; [self.navigationController pushViewController:editProject animated:YES]; NSLog(@"xxxxxxxxxxxxxxx"); } But since i used ARC the navigation may dealoc immediately and it doesn't work, All the actions in method works except push to the next view if i do same thing with out ARC it works fine How to resolve this issue..? Thanks in advance

    Read the article

  • Launch a new page in Zend/php on button click

    - by BlueMonster
    PHP & Zend Noob here I've downloaded the skeleton project from here: https://github.com/zendframework/ZendSkeletonApplication Say i want to open a new page that simply displays "hello world" text if click on the "ZF2 Development Portal" button(bottom left green button) on the page that launches --- how do i do this? See image: I've read through this tutorial, but i'm not sure how the model, view, or controller are actually launched? See tutorial: http://blog.wilgucki.pl/2012/07/tworzenie-modulw-w-zend-framework-2.html From looking at the code, i know that i will have to change this line of code: <div class="span4"> <h2><?php echo $this->translate('Follow Development') ?></h2> <p><?php echo sprintf($this->translate('Zend Framework 2 is under active development. If you are interested in following the development of ZF2, there is a special ZF2 portal on the official Zend Framework website which provides links to the ZF2 %swiki%s, %sdev blog%s, %sissue tracker%s, and much more. This is a great resource for staying up to date with the latest developments!'), '<a href="http://framework.zend.com/wiki/display/ZFDEV2/Home">', '</a>', '<a href="http://framework.zend.com/zf2/blog">', '</a>', '<a href="http://framework.zend.com/issues/browse/ZF2">', '</a>') ?></p> <p><a class="btn btn-success" href="http://framework.zend.com/zf2" target="_blank"><?php echo $this->translate('ZF2 Development Portal') ?> &raquo;</a></p> </div> More specifically this line: <p><a class="btn btn-success" href="http://framework.zend.com/zf2" target="_blank"><?php echo $this->translate('ZF2 Development Portal') ?> &raquo;</a></p> but i'm really confused as to what i'm supposed to change it to in order to launch a new page. Any ideas? Thanks in advance!

    Read the article

  • javascript split() array contains

    - by Mahesha999
    While learning JavaScript, I did not get why the output when we print the array returned of the Sting.split() method (with regular expression as an argument) is as explained below. var colorString = "red,blue,green,yellow"; var colors = colorString.split(/[^\,]+/); document.write(colors); //this print 7 times comma: ,,,,,,, However when I print individual element of the array colors, it prints an empty string, three commas and an empty string: document.write(colors[0]); //empty string document.write(colors[1]); //, document.write(colors[2]); //, document.write(colors[3]); //, document.write(colors[4]); //empty string document.write(colors[5]); //undefined document.write(colors[6]); //undefined Then, why printing the array directly gives seven commas. Though I think its correct to have three commas in the second output, I did not get why there is a starting (at index 0) and ending empty string (at index 4). Please explain I am screwed up here.

    Read the article

  • how to create static line in coreplot

    - by Rémi Bédard-Couture
    I am trying to make my control lines static so instead of being displayed as part of the graph(the control lines are moving with the graph), they would be displayed like an axis the app can only scroll horizontally i'm talking about the two red line and the green line(which i put over the x axis) this is how i do my lines: // Center line CPTScatterPlot *centerLinePlot = [[CPTScatterPlot alloc] init]; centerLinePlot.identifier = kCenterLine; CPTMutableLineStyle *lineStyle = [CPTMutableLineStyle lineStyle]; lineStyle.lineWidth = 2.0; lineStyle.lineColor = [CPTColor greenColor]; centerLinePlot.dataLineStyle = lineStyle; centerLinePlot.dataSource = self; [graph addPlot:centerLinePlot]; but maybe it has something to do with the displayed range: ////////ajuste la portion a voir if(data.Resultats.count>10) { plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(data.Resultats.count - 10) length:CPTDecimalFromDouble(10)]; } plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromDouble(RangeMin) length:CPTDecimalFromDouble(RangeMax-RangeMin)]; // Adjust visible ranges so plot symbols along the edges are not clipped CPTMutablePlotRange *xRange = [plotSpace.xRange mutableCopy]; CPTMutablePlotRange *yRange = [plotSpace.yRange mutableCopy]; //place l'axe x sur la ligne de controle pour voir les WorkOrders x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(center); //x.orthogonalCoordinateDecimal = yRange.location; //y.orthogonalCoordinateDecimal = xRange.location; //x.visibleRange = xRange; //y.visibleRange = yRange; //x.gridLinesRange = yRange; //y.gridLinesRange = xRange; [xRange expandRangeByFactor:CPTDecimalFromDouble(1.15)];//1.05 [yRange expandRangeByFactor:CPTDecimalFromDouble(1.15)]; plotSpace.xRange = xRange; plotSpace.yRange = yRange;

    Read the article

  • How do you handle the tension between refactoring and the need for merging?

    - by Xavier Nodet
    Hi, Our policy when delivering a new version is to create a branch in our VCS and handle it to our QA team. When the latter gives the green light, we tag and release our product. The branch is kept to receive (only) bug fixes so that we can create technical releases. Those bug fixes are subsequently merged on the trunk. During this time, the trunk sees the main development work, and is potentially subject to refactoring changes. The issue is that there is a tension between the need to have a stable trunk (so that the merge of bug fixes succeed -- it usually can't if the code has been e.g. extracted to another method, or moved to another class) and the need to refactor it when introducing new features. The policy in our place is to not do any refactoring before enough time has passed and the branch is stable enough. When this is the case, one can start doing refactoring changes on the trunk, and bug-fixes are to be manually committed on both the trunk and the branch. But this means that developpers must wait quite some time before committing on the trunk any refactoring change, because this could break the subsequent merge from the branch to the trunk. And having to manually port bugs from the branch to the trunk is painful. It seems to me that this hampers development... How do you handle this tension? Thanks.

    Read the article

  • jquery touch punch - draggable on ipad

    - by dshuta
    i am starting to work with the jquery touch punch extensions in order to allow draggability on ipad, but i am getting tripped up right away. probably something terribly dumb on my part. the draggable example from the developer works fine on my ipad: http://furf.com/exp/touch-punch/draggable.html but not for me: http://danshuta.com/touchpunch/ this works fine in my desktop browser, but on the ipad it just focuses on the block and scrolls the entire page as i drag, as if it were just an image or other normal embedded object. as this is what happens normally with jquery/ui on ipad, this makes me think it is not loading or otherwise ignoring the "punch" code from my site (though if i host the jquery files on my site via the same path, those load and function fine in desktop browser). here's the entire code, very basic: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Touchpunchtest</title> <script src="http://code.jquery.com/jquery.min.js"></script> <script src="http://code.jquery.com/ui/1.8.17/jquery-ui.min.js"></script> <script src="js/jquery.ui.touch-punch.js"></script> </head> <body> <div id="draggybox" onclick="void(0)" style="width: 150px; height: 150px; background: green;"></div> <script>$('#draggybox').draggable();</script> </body> </html> what am i missing?!

    Read the article

  • Limiting the width of a TextBlock in Silverlight

    - by Druzil
    The obvious MaxWidth gets ignored and the text in the "DisplayBox" TextBlock displays the whole text even if this text continues past the parent container controls (to the edge of the silverlight area. <win:HierarchicalDataTemplate x:Key="hierarchicalTemplate" ItemsSource="{Binding _children}"> <Border BorderThickness="0" BorderBrush="Orange" HorizontalAlignment="Stretch" Background="{Binding Converter={StaticResource BackgroundConverter}}"> <toolkit:DockPanel LastChildFill="True" Width="{Binding HeirarchyLevel, Converter={StaticResource WidthConverter}}" Height="20"> <Canvas toolkit:DockPanel.Dock="Right" Width="20" MouseLeftButtonUp="Arrow_MouseLeftButtonDown"> <Rectangle Width="20" Height="20" Fill="Transparent" /> <Line Stroke="Black" X1="5" Y1="10" X2="17" Y2="10" /> <Line Stroke="Black" X1="11" Y1="5" X2="17" Y2="10" /> <Line Stroke="Black" X1="11" Y1="15" X2="17" Y2="10" /> </Canvas> <Ellipse Canvas.Top="5" Width="10" Height="10" Fill="Green" toolkit:DockPanel.Dock="Right" MouseLeftButtonDown="Ellipse_MouseLeftButtonDown" /> <Canvas Width="Auto" Loaded="TextArea_Loaded"> <TextBlock Name="DisplayBox" FontFamily="Arial" FontSize="17" Foreground="Black" Width="Auto" Text="{Binding TaskName}" MouseLeftButtonUp="TextBlock_MouseLeftButtonUp" /> <TextBox Name="EditBox" FontFamily="Arial" FontSize="10" Foreground="Black" Height="20" Text="{Binding TaskName}" Visibility="Collapsed" LostFocus="TextBox_LostFocus" /> <Line Stroke="Black" X1="0" Y1="10" X2="202" Y2="10" Width="Auto" /> </Canvas> </toolkit:DockPanel> </Border> </win:HierarchicalDataTemplate>

    Read the article

  • UIPickerview filter list from a user previous textfield input

    - by user1547180
    int variabla; - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView { return 1; } - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component { if (variabla == 1) return list4.count; else if(variabla == 2) return list3.count; if (variabla == 3) return list1.count; if (variabla == 4) return list2.count; return YES; [pickerView reloadAllComponents]; } - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { if (variabla == 1) { subjectField.text = [list4 objectAtIndex:row]; } else if (variabla == 2) { gradeField.text = [list3 objectAtIndex:row]; } else if (variabla == 3) { mathField.text = [list1 objectAtIndex:[pickerView selectedRowInComponent:0]]; selectedRow = [pickerView selectedRowInComponent:0]; coreTView.text = [mathMeaning objectAtIndex:selectedRow]; } if (variabla == 4) { elaField.text = [list2 objectAtIndex:[pickerView selectedRowInComponent:0]]; selectedRow = [pickerView selectedRowInComponent:0]; coreTView.text = [elaMeaning objectAtIndex:selectedRow]; } [pickerView reloadAllComponents]; NSLog(@"row selected is %d", selectedRow); } - (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { if (variabla == 1) return [list4 objectAtIndex:row]; if (variabla == 2) return [list3 objectAtIndex:row]; if (variabla == 3) return [list1 objectAtIndex:row]; if (variabla == 4) return [list2 objectAtIndex:row]; return NO; [pickerView reloadAllComponents]; } Hey I would like to know or pointed in the right direction on how to load a UIPickerView based on the user input from a previous uitextfield so if they type in the previous textfield apple I would like red, green, blue to show in the UIPickerView or if they type orange I would like to see orange, yellow grape thanks for the help in advance.

    Read the article

  • Is using a GUI worse than using bash and other text interface tools?

    - by Glycerine
    As a freelancer, and previous Adobe trainer, I get a look-in at many development workflows and alternate styles of programming and design and therefore quite open to different workflows. But a recent post I had, I needed to use SQL - so I whipped out navicat and wrote a nice join statement. I had sniggering comments and sideways glances when I told the developers I was working with navicat, I preferred a GUI to bash and I prefer Aptana to notepad. I felt a little insulted and under skilled as I didn't want to sit in front of reams of spewing green text. I know and use the tools when required but I prefer more attractive, modern products. Have you guys had this? What do you do to overcome it - apart from using bash and notepad more? How do you subdue a developer who's being arrogant about his skill? And is it my fault? I hope this question is not subjective, I do feel like I am inferior to my peers due to it - so some advise would really help.

    Read the article

  • How do I get this linearlayout working on android?

    - by Arkadiy
    I'm trying to create a scrollview that contains a linearlayout with some options inside of it. I'd like for the options to show up at the top and grow downwards, and to have "save," "delete," and "cancel" buttons which show up at the very bottom of the screen (if there is space left in between the bottom of all the options and the top of the buttons). Here's a screenshot of my attempt: http: //img375.imageshack.us/img375/3628/10370572.png (StackOverflow was only letting me post a single link so you'll have to get rid of the space in between http: and the rest) As you can see, the buttons show up directly below the options rather than at the bottom of the screen. In fact the top level (green) linearlayout doesn't even extend all the way down, despite having a height of fill_parent and a weight of 1 (and the blue is the scrollview, so there is room to expand). I've tried every possible combination of heights, weights, gravities, and anything else to get this working and still can't do it. Everytime I pasted my xml layout into here, the top and bottom portions got cut off, so instead I pasted it here: pastey link Can anyone see what I'm doing wrong?

    Read the article

  • Returning JSON object from an ASP.NET page

    - by Emin
    Hi, In my particular situation, I have couple of solutions to my problem. I want to find out which one is more feasible. In this case, I can also achieve my goal by returning a JSON object from my server side code, however, I do not know how it is done and what is the best way of doing it. First off, I don't need a full aspx page as I only need a response returned from code. So, do I use web services? handler? or is there any other specific way you people do this? Is this solution feasible? do I build the JSON string using the StringBuilder class and inject that string into the target aspx page? are there any precautions? or things that I should be aware of? I appreciate your ideas. Regards, Kemal ------------UPDATE !------------ Suppose I have a JSON object in my userlist.aspx page. which then I use it with jQuery... {"menu": { "id": "color1", "value": "color", "popup": { "menuitem": [ {"value": "Red"}, {"value": "Green"}, {"value": "Yellow"} ] } }} // example taken from the json.org/example page now when I want to add a new menuitem from my aspx page, what do I do... I think this way my question is more specific... Lets assume I create a new string in my aspx code, as such "{"value": "Blue"}. Now how do I inject this into the already existing itemlist in the target page? or is this not the correct approach to this kind of situation? if not how else can it be achieved? Also if I wanted to fire a jquery event when a new item is added to this list, how is this achieved?

    Read the article

  • Can we solve the table row background image problem, in chrome, in multi celled tables??

    - by Ya'el
    It is frequently asked – but I haven’t seen a good answer yet (and I looked). If you set a background image in CSS to a table row- the image will repeat itself in every cell. If you set the position: relative (for the row) and set the background-image: none (for the cells) it solves the problem on IE but not on chrome! I can't use background positioning since there are many calls and their size varies. (And the picture is not symmetrical- It's a fade out from one side. Anybody?? Example for the css code : tr { height: 30px; position:relative;} tr.green {background: url('green_30.png') no-repeat left top;} tr.orange {background: url('oranger_30.png') no-repeat left top;} tr.red {background: url('red_30.png') no-repeat left top;} td {background-image:none;} The HTML is basic - A multi cell table. The goal is to have different colors fade into every row, but it could be any non-pattern image.

    Read the article

  • Javascript - event listener toggle button

    - by user2546157
    I'm trying to create a button which can toggle "double click" to "single click" and in the opposite. For some reason, once it toggles to single click and it cannot toggle back. Can anyone please help! function init() { normal_listeners(); } function addListener(){ var image1 = document.getElementById('image_1'); var image2 = document.getElementById('image_2'); var image3 = document.getElementById('image_3'); if(document.getElementById('listener_1').value == "Listener"){ document.getElementById('listener_1').style.backgroundColor = "red"; alert("Normal"); image1.addEventListener("dblclick", function(){userChoice(1);}, false); image2.addEventListener("dblclick", function(){userChoice(2);}, false); image3.addEventListener("dblclick", function(){userChoice(3);}, false); document.getElementById('listener_1').value = "Normal"; } else if(document.getElementById('listener_1').value == "Normal") { document.getElementById('listener_1').style.backgroundColor = "green"; alert("Listener"); image1.addEventListener("click", function(){userChoice(1);}, false); image2.addEventListener("click", function(){userChoice(2);}, false); image3.addEventListener("click", function(){userChoice(3);}, false); document.getElementById('listener_1').value = "Listener"; } } function normal_listeners(){ var image1 = document.getElementById('image_1'); var image2 = document.getElementById('image_2'); var image3 = document.getElementById('image_3'); var listener1 = document.getElementById('listener_1'); listener1.addEventListener("click", addListener, false); image1.addEventListener("dblclick", function(){userChoice(1);}, false); image2.addEventListener("dblclick", function(){userChoice(2);}, false); image3.addEventListener("dblclick", function(){userChoice(3);}, false); } window.onload = init; <img id="image_1" src="rock.jpg" alt="ROCK" width="100" height="100"> <img id="image_2" src="paper.jpg" alt="PAPER" width="100" height="100"> <img id="image_3" src="scissors.jpg" alt="SCISSORS" width="100" height="100"> <input type="button" id="listener_1" value="Normal" style="background-color:red">

    Read the article

  • Continuous build infrastructure recommendations for primarily C++; GreenHills Integrity

    - by andersoj
    I need your recommendations for continuous build products for a large (1-2MLOC) software development project. Characteristics: ClearCase revision control Approx 80% C++; 15% Java; 5% script or low-level Compiles for Green Hills Integrity OS, but also some windows and JVM chunks Mostly an embedded system; also includes some UI pieces and some development support (simulation tools, config tools, etc...) Each notional "version" of the deliverable includes deployment images for a number of boards, UI machines, etc... (~10 separate images; 5 distinct operating systems) Need to maintain/track many simultaneous versions which, notably, are built for a variety of different board support packages Build cycle time is a major issue on the project, need support for whatever features help address this (mostly need to manage a large farm of build machines, I guess..) Operates in a secure environment (this is a gov't program) (Edited to add: This is a classified program; outsourcing the build infrastructure is a non-starter.) Interested in any best practices or peripheral guidance you might offer. The build automation issues is one of several overlapping best practices that appear to be missing on the program, but try to keep your answers focused on build infrastructure piece and observations directly related. Cost is not an object. Scalability and ease of retrofitting onto an existing infrastructure are key. JA

    Read the article

  • Error or not and insert to database mysql

    - by Azzyh
    Why wont this work? <?php include "top.php"; include "connect.php"; if(isset($_POST["submit"])) { $error = ""; if(empty($_POST["name"])) { $error .= "Du glömde märket!<br>"; if(empty($_POST["rating"])){ $error .= "Du glömde att bedömma märket!<br>"; if(empty($_POST["worth"])){ $error .= "Du glömde att välja vilken klass den hör till!<br>"; if(empty($_POST["username"])){ $error .= "Du glömde att skriva ditt namn!<br>"; if(empty($_POST["rating"])){ $error .= "Du glömde att skriva någonting?!!<br>"; }}}}} if(!empty($error)){ echo $error; }else{ $name = $_POST["name"]; $rating = $_POST["rating"]; $worth = $_POST["worth"]; $favorite = $_POST["favorite"]; $username = $_POST["username"]; $description = $_POST["description"]; mysql_query("INSERT INTO brands (name, rating, worth, favorite, username, description) VALUES ('$name', '$rating', '$worth', '$favorite', '$username', '$description')"); echo "<span style='color: green'>Yir yir, <a href='brand.php'>klicka här för att gå till Märken.</a></span>"; } } It doesnt come with errors it just say the succeed message like it has inserted to database

    Read the article

  • Make floating element "maximally wide"

    - by bobobobo
    I have some floating elements on a page. What I want is the div that is floated left to be "maximally wide" so that it is as wide as it possibly can be without causing the red div ("I go at the right") to spill over onto the next line. An example is here: The width:100%; doesn't produce the desired effect! ** I don't want the green element ("I want to be as wide as possible") to go "under" the red element. Its very important that they both stay separate i.e. .. I think they must both be floated! <div class="container"> <div class="a1">i go at the right</div> <div class="a2">i want to be as wide as possible,</div> <div class="clear"></div> </div> <style> div { border: solid 2px #000; background-color: #eee; margin: 8px; padding: 8px; } div.a1 { float:right; background-color: #a00; border: solid 2px #f00; margin: 12px; padding: 6px; } div.a2 { float: left; /*width: 100%;*/ /*this doens't produce desired effect!*/ background-color: #0b0; border: solid 2px #0f0; margin: 12px; padding: 14px; } .clear { border: none; padding: 0 ; margin: 0; clear:both; } </style>

    Read the article

  • Why pseudo-elements :before and :after appear in front of my DIV element and not behind?

    - by Dim13i
    I have a DIV element with this given class: .slideshow { background: white; width: 700px; height: 300px; padding:10px; margin: 0 auto; position: relative; box-shadow: 0px 0px 5px grey, 0px 10px 20px rgba(0,0,0,.1) inset; } I define those two pseudo-elements (:before and :after): .slideshow:before, .slideshow:after { content: " "; background: green; width: 50%; height: 50%; position: absolute; z-index: -10; } My problem is that those two pseudo-elements appear in front of my DIV and not behind. Is there any specific reason for this behaviour? Here is an example: EXAMPLE The Javascript part is a bit messy but i'm still working on it. Also I've noticed that if I delete all the JS part I don't have anymore this problem, but I don't think there is anything in the code that should modify the slideshow DIV SOLVED: The problem is in the javascript part where I have: $('.slideshow').css('-webkit-transform', 'rotate(0deg)'); Removing this line solved the problem. I guess that pseudo-elements :before and :after are not compatible with the property transform.

    Read the article

  • Valid javascript object property names

    - by hawkettc
    I'm trying to work out what is considered valid for the property name of a javascript object. For example var b = {} b['-^colour'] = "blue"; // Works fine in Firefox, Chrome, Safari b['colour'] = "green"; // Ditto alert(b['-^colour']); // Ditto alert(b.colour); // Ditto for(prop in b) alert(prop); // Ditto //alert(b.-^colour); // Fails (expected) This post details valid javascript variable names, and '-^colour' is clearly not valid (as a variable name). Does the same apply to object property names? Looking at the above I'm trying to work out if b['-^colour'] is invalid, but works in all browsers by quirk, and I shouldn't trust it to work going forward b['-^colour'] is completely valid, but it's just of a form that can only be accessed in this manner - (it's supported so Objects can be used as maps perhaps?) Something else As an aside, a global variable in javascript might be declared at the top level as var abc = 0; but could also be created (as I understand it) with window['abc'] = 0; the following works in all the above browsers window['@£$%'] = "bling!"; alert(window['@£$%']); Is this valid? It seems to contradict the variable naming rules - or am I not declaring a variable there? What's the difference between a variable and an object property name? Cheers, Colin

    Read the article

< Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >