Search Results

Search found 7418 results on 297 pages for 'argument passing'.

Page 48/297 | < Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >

  • Passing an address inside a WordPress post to a Google Map elsewhere on the Page

    - by ael_ecurai
    Background: My client is building their own WordPress site (using a purchased feature-rich theme), and I'm modifying a child theme as necessary to achieve customizations she wants. The theme comes with a Page template that includes a full-width Google Map across the top, which pulls its marker from a single address set within the Theme Options. It's meant to be used for one main "Contact Us" page. The client's business has several locations, and she wants each location's page to include such a map. (Example linked below.) It seems that the ideal solution would be the ability to specify an address within a shortcode in the Post, and have that set the map marker. Here's how the theme makes the map (where $mapAddress is the address from the Theme Options): <?php $mapAddress = ot_get_option( 'map_address' ); $mapHeight = ot_get_option( 'map_height' ); $mapContent = ot_get_option( 'map_content' ); ?> <section id="block-map-wrapper"> <div id="block-map" class="clearfix"> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=true"></script> <script> jQuery(document).ready(function(){ // Map Options var mapOptions = { zoom: 15, scrollwheel: false, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL, position: google.maps.ControlPosition.TOP_LEFT }, mapTypeControl: true, scaleControl: false, panControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP }; // The Map Object var map = new google.maps.Map(document.getElementById("map"), mapOptions); var address = ""; var geocoder = new google.maps.Geocoder(); geocoder.geocode({ "address" : "<?php echo $mapAddress; ?>" }, function (results, status) { if (status == google.maps.GeocoderStatus.OK) { address = results[0].geometry.location; map.setCenter(results[0].geometry.location); var marker = new google.maps.Marker({ position: address, map: map, clickable: true, animation: google.maps.Animation.DROP }); var infowindow = new google.maps.InfoWindow({ content: "<?php echo $mapContent; ?>" }); google.maps.event.addListener(marker, "click", function() { infowindow.open(map, marker); }); } }); }); </script> <div id="map" class = "map" style = "width: 100%; height: <?php echo $mapHeight; ?>px"></div> </div><!-- #block-map --> <div class="shadow-bottom"></div> </section><!-- #block-map-wrapper --> Here's a test page using a custom Page template I've created. Right now it's using the same map code as above. I've tried creating a shortcode that takes an address attribute and sets it as $mapAddress, but that didn't work. I believe it's because the map is already loaded by the time the Loop gets parsed. How can I tell Maps to "come back" to the post to get the proper address? My specialty lies in HTML & CSS, but Javascript befuddles me fairly easily, so please be explicit when explaining implementation. Bonus: A further goal is to have the locations' parent Page also include such a map, but have multiple markers representing the multiple locations. When taking more than one location, Google Maps only accepts latitude/longitude. I don't want my client to be concerned with coordinates, so I know there's got to be something I can do with the geocoding service so she can just input a list of addresses instead (into the same, or similar, shortcode solution developed for my main question). But I am extra-clueless about how to do that.

    Read the article

  • JQuery\Javascript - Passing a function as a variable.

    - by Josh
    I was just curious if I could pass a function as a variable. For example: I have a function $('#validate').makeFloat({x:671,y:70,limitY:700}); I would like to do something like this: $('#validate').makeFloat({x:function(){ return $("#tabs").offset().left+$("#tabs").width();},y:70,limitY:700}); This does not work, but ideally every time the variable was accessed it would compute the new value. So if the window was resized it would automatically adjust as opposed to a variable passed in being static. I realize I can implement this directly inside the function\widget, but I was wondering if there was some way to do something like the above.

    Read the article

  • Chrome extension - Message Passing

    - by Felipe Barreiros
    Hey there. I'm trying to get the info that is set on the Options Page to alter the behavior of my extension. Basically, if a checkbox on OptionsPage is set to true, the extension runs, otherwise it doesn't. I'm returning true on the background.html for testing purposes, but still, it doesn't work. Would you guys help me out? Thanks! Code being injected to the page: if(chrome.extension.sendRequest() == 'true') alert("checkbox set to true"); else alert("it is disabled"); background.html <script> chrome.extension.onRequest.addListener(function(){ return true; } </script>

    Read the article

  • Passing operator as a parameter

    - by nacho4d
    Hi, I want to have a function that evaluates 2 bool vars (like a truth table) for example: since T | F : T then myfunc('t', 'f', ||); /*defined as: bool myfunc(char lv, char rv, ????)*/ should return true; how can I pass the third parameter? (I know is possible to pass it as a char* but then I will have to have another table to compare operator string and then do the operation which is something I would like to avoid) Is it possible to pass an operator like ^(XOR) or ||(OR) or &&(AND), etc in a function/method? Thanks in advance

    Read the article

  • passing javascript value in html url link

    - by pradeep
    $.post("/diabetes/ropimages/getcount.php",{pid:$("#patient_id").val()} ,function(data1){ //alert(data1); var count = data1; var pid = $("#patient_id").val(); var rid; for( var i = 1 ; i <= count ; i++) { var link ='<img src="/diabetes/ropimages/thumbpicdisplay.php?pid=+pid+&rid=1" />'; $("#content1").empty().html(link); } }); i am trying to pass pid value in url ..but its taking directly as +pid+ as value ..how do i give it the value of pid. and how do i print 3 images in a div ? like the one in code

    Read the article

  • Declaring an array of character pointers (arg passing)

    - by Isaac Copper
    This is something that should be easy to answer, but is more difficult for me to find a particular right answer on Google or in K&R. I could totally be overlooking this, too, and if so please set me straight! The pertinent code is below: int main(){ char tokens[100][100]; char str = "This is my string"; tokenize(str, tokens); for(int i = 0; i < 100; i++){ printf("%s is a token\n", token[i]); } } void tokenize(char *str, char tokens[][]){ //do stuff with string and tokens, putting //chars into the token array like so: tokens[i][j] = <A CHAR> } So I realize that I can't have char tokens[][] in my tokenize function, but if I put in char **tokens instead, I get a compiler warning. Also, when I try to put a char into my char array with tokens[i][j] = <A CHAR>, I segfault. Where am I going wrong? (And in how many ways... and how can I fix it?) Thanks so much!

    Read the article

  • Passing input to Ant's <exec> task

    - by mikek
    I have an Ant script running a standard -task after taking in an inputed password: <input message="Password:" addproperty="password"> <handler classname="org.apache.tools.ant.input.SecureInputHandler" /> </input> <exec executable="/bin/sh" input="${password}" failonerror="true"> <arg line='-c "myScript.sh"' /> </exec> The script myScript.sh prompts the user for a password, and, it was my understanding that from the Ant documentation that input is supposed relay input into whatever the <exec> task is executing, but instead I get (for entering the password foobar) [exec] Failed to open /usr/local/foobar which is followed by a stack trace from my script complaining about an incorrect password...so obviously I've understood the documentation wrong. Does anybody know how to handle prompted input from external scripts in Ant?

    Read the article

  • using php Download File From a given URL by passing username and password for http authentication

    - by Acharya
    Hi all, I need to download a text file using php code. The file is having http authentication. What procedure I should use for this. Should I use fsocketopen or curl or Is there any other way to do this? I am using fsocketopen but it does not seem to work. $fp=fsockopen("www.example.com",80,$errno,$errorstr); $out = "GET abcdata/feed.txt HTTP/1.1\r\n"; $out .= "User: xyz \r\n"; $out .= "Password: xyz \r\n\r\n"; fwrite($fp, $out); while(!feof($fp)) { echo fgets($fp,1024); } fclose($fp); Here fgets is returning false. Any help!!!

    Read the article

  • Passing Object From Controller to JavaScript JQuery

    - by TMan
    This is driving me crazy. All I'm trying to do is to pass in a Id to a ActionMethod which is working and have an Object be returned to the javascript. Then in javascript, I want to be able to say something like..Objec.Property, ie/ Student.Name, or Student.GPA. Any help is appreciated. I tried json but couldn't get that to work either. ActionResult: [AcceptVerbs(HttpVerbs.Get)] public Epic GetEpicPropertyDetails(int id) { var Epictemplist = epicRepository.Select().Where(x => x.Id.Equals(id)); return Epictemplist.SingleOrDefault(); } javascript: <script type="text/javascript"> $(document).ready(function () { $(".ListBoxClass").click(function (event) { var selectedid = $(this).find("option:selected").val(); event.preventDefault(); $.get("/Estimate/GetEpicPropertyDetails", { id: selectedid }, function (result) { $(".TimeClass").val(result); }); }); }); </script> result.Name is obviously wrong I just dont know how to call this the right way.

    Read the article

  • Passing values for multi-value parameter in SSRS query string

    - by Andy Xufuris
    I have two reports built using SSRS 2005. The first report is set to navigate to the second when a specific field is clicked. There is a multi-value parameter on the second report. I need to pass multiple values for this parameter in the URL query string when calling this report. Is there a way to pass multiple values for a parameter in the query string of a report? Or can you pass a parameter that will cause the Select All value to be selected?

    Read the article

  • Passing values into regex match function

    - by Tim
    In python (it's a Django filter), I'm doing this: lReturn = re.sub(r'\[usecase:([ \w]+)]', r'EXTEND WITH <a href="/usecase/%s/\1/">\1</a>' % pCurrentProjectName, lReturn) I'd like to use a function instead of a string (so I can check that the usercase is a valid name), so it would change to this: def _match_function(matchobj): lMatch = matchobj.group(1) return "EXTEND WITH <a href='/usecase/%s/%s/'>%s</a>" % (pCurrentProjectName, lMatch, lMatch) lReturn = re.sub(r'\[usecase:([ \w]+)]', _match_function, lReturn) How do I get pCurrentProjectName into the _match_function() function?

    Read the article

  • passing paramter as to webservcie function in wcf

    - by prince23
    hi, this my datagrid event here i am calling the webservice. private void dgProject_RowDetailsVisibilityChanged(object sender, DataGridRowDetailsEventArgs e) { WSDataServiceClient wsService = new WSDataServiceClient(); wsService.GetProjectCompleted += new EventHandler<GetProjectCompletedEventArgs>(wsService_GetProjectCompleted); wsService.GetProjectAsync(strUniqueName); // here can i send datagrid as an parameter to the function? Datagrid gd= new Datagrid(); } void wsService_GetProjectCompleted(object sender, GetProjectCompletedEventArgs e) { // } is there any way that i can send datagrid as a paramter to this function is it possiable to do? beacuse i will be using the same websevice function her but need to bind result with different datagrid based on the condition if i can send a datagrid as paramter to this function i can reduce the code so any help on this issue would be great thank you.

    Read the article

  • Message passing chrome extension

    - by Mayur Kataria
    I wants to create an extension where content script will send message to background page and then on browser action means clicking on extension icon will access that background page and get some data.I am using chrome Version 23.0.1271.64 m on windows8. I am getting following error. Port error: Could not establish connection. Receiving end does not exist. I tried to solve the same. but people are using sendRequest which is not supported by chrome20+. i also found solution mentioned for chrome 20+. But not working. Please help. Below is the file contents. manifest.json { "name": "Test Extension", "version": "1.0", "manifest_version": 2, "description": "A test extension.", "background": "background.html", "content_scripts": [ { "matches": ["<all_urls>"], "js": ["jquery.js","content.js"] } ], "permissions": ["tabs", "http://*/", "https://*/"], "browser_action": { "default_icon": "icon.png", "default_popup": "popup.html" } } background.html <html> <head> <script src="background.js"></script> </head> <body> <h1>Wy</h1> </body> </html> background.js chrome.extension.onMessage.addListener(function(request, sender, sendResponse) { // Chrome 20+ alert(request); console.log('received in listener'); sendResponse({farewell: "goodbye"}); }); content.js $(function(){ console.log('start-sending message'); chrome.extension.sendMessage({greeting: "hello"},function(response){alert(response);}); console.log('end-sending message'); }); popup.html <!doctype html> <html> <head> <title>Getting Started Extension's Popup</title> </style> <!-- JavaScript and HTML must be in separate files for security. --> <script src="jquery.js"></script> <script src="popup.js"></script> </head> <body> </body> </html> popup.js $(function(){ var str_html = "<tr><td width='60%'>S</td><td width='40%'>15</td></tr><tr><td width='60%'>M</td><td width='40%'>25</td></tr>"; $('#sizes_container').html(str_html); var bkg = chrome.extension.getBackgroundPage(); console.log(bkg); });

    Read the article

  • Restoring and passing data to an already running instance of a .NET application

    - by mtranda
    The goal is to have an application that runs in the system tray and can either accept user input from its actual GUI (which isn't the actual issue) OR accept command line parameters (that would actually be done via a context menu in windows explorer). Now, while I'm aware that the command line parameters are not exactly possible once the application has started, I need a way to pass data to the already running application instance via some form of handler. I'm thinking maybe define and raise some sort of event? Thanks in advance.

    Read the article

  • Passing System classes as constructor parameters

    - by mcl
    This is probably crazy. I want to take the idea of Dependency Injection to extremes. I have isolated all System.IO-related behavior into a single class so that I can mock that class in my other classes and thereby relieve my larger suite of unit tests of the burden of worrying about the actual file system. But the File IO class I end up with can only be tested with integration tests, which-- of course-- introduces complexity I don't really want to deal with when all I really want to do is make sure my FileIO class calls the correct System.IO stuff. I don't need to integration test System.IO. My FileIO class is doing more than simply wrapping System.IO functions, every now and then it does contain some logic (maybe this is the problem?). So what I'd like is to be able to test my File IO class to ensure that it makes the correct system calls by mocking the System.IO classes themselves. Ideally this would be as easy as having a constructor like so: public FileIO( System.IO.Directory directory, System.IO.File file, System.IO.FileStream fileStream ) { this.Directory = directory; this.File = file; this.FileStream = fileStream; } And then calling in methods like: public GetFilesInFolder(string folderPath) { return this.Directory.GetFiles(folderPath) } But this doesn't fly since the System.IO classes in question are static classes. As far as I can tell they can neither be instantiated in this way or subclassed for the purposes of mocking.

    Read the article

  • .htaccess & mod_rewrite for passing GET parameters

    - by Joel Alejandro
    Currently I use this to pass GET parameters on an "elegant" way: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]*)/$ index.php?module=$1 [L] RewriteRule ^([^/]*)/([^/]*)/$ index.php?module=$1&object=$2 [L] RewriteRule ^([^/]*)/([^/]*)/([^/]*)/$ index.php?module=$1&object=$2&submodule=$3 [L] This works great for 3 parameters max., (and I'm sure it's seriously ugly). Any way to do the same thing, for n-paremeters?

    Read the article

  • passing data to and from server using xml

    - by sapna
    i need to design a web site in which data is passed to and from the server using xml.i got it how to transform data from database to xml and then to html.but i am not able to find how to pass data from client to server using xml.webpages are designed using asp.is it possible to do pass data from client to server using xml.what are the things that are to be studied.help needed immediately.

    Read the article

  • Passing arguments and conditions to model in codeigniter

    - by stormdrain
    I'm adding some models to a project, and was wondering if there is a "best practice" kind of approach to creating models: Does it make sense to create a function for each specific query? I was starting to do this, then had the idea of creating a generic function that I could pass parameters to. e.g: Instead of function getClients(){ return $this->db->query('SELECT client_id,last FROM Names ORDER BY id DESC'); } function getClientNames($clid){ return $this->db->query('SELECT * FROM Names WHERE client_id = '.$clid); } function getClientName($nameID){ return $this->db->query('SELECT * FROM Names WHERE id ='.$nameID); } } Something like function getNameData($args,$cond){ if($cond==''){ $q=$this->db->query('SELECT '.$args.' FROM Names'); return $q; }else{ $q=$this->db->query('SELECT '.$args.' FROM Names WHERE '.$cond); return $q; } } where I can pass the fields and conditions (if applicable) to the model. Is there a reason the latter example would be a bad idea? Thanks!

    Read the article

  • passing the parent form on the onclick event to javascript function

    - by user1051505
    Hi I am trying to pass variables on the onclick event to a javascript function. I am trying the following way, I can't get the input value in the javascript function.(I am expecting an alert of 1.) Is it the right way of doing this? Please help. <head> <script> function submit_value(form) { alert(form.ip.value); } </script> </head> <table> <tr> <form> <td> <input id="ip" type="text" value="1"> </td> <td> <a href="javascript:;" onClick="submit_value(this)">Button</a> </td> </form> </tr> </table>

    Read the article

  • Passing functor and function pointers interchangeably using a templated method in C++

    - by metroxylon
    I currently have a templated class, with a templated method. Works great with functors, but having trouble compiling for functions. Foo.h template <typename T> class Foo { public: // Constructor, destructor, etc... template <typename Func> void bar(T x, Func f); }; template <typename T> template <typename Func> Foo::bar(T x, Func f) { /* some code here */ } Main.cpp #include "Foo.h" template <typename T> class Functor { public: Functor() {} void operator()(T x) { /* ... */ } private: /* some attributes here */ }; void Function(T x) { /* ... */ } int main() { Foo<int> foo; foo.bar(2, Functor); // No problem foo.bar(2, Function); // <unresolved overloaded function type> return 0; }

    Read the article

  • Passing around objects to network packet handlers ?

    - by xeross
    Hey, I've been writing a networking server for a while now in C++ and have come to the stage to start looking for a way to properly and easily handle all packets. I am so far that I can figure out what kind of packet it is, but now I need to figure out how to get the needed data to the handler functions. I had the following in mind: Have a map of function pointers with the opcode as key and the function pointer as value Have all these functions have 2 arguments, packet and ObjectAccessor ObjectAccessor class contains various functions to fetch various items such as users and alike Perhaps pass the user's guid too so we can fetch it from the objectaccessor I'd like to know the various implementations others have come up with, so please comment on this idea and reply with your own implementations. Thanks, Xeross

    Read the article

< Previous Page | 44 45 46 47 48 49 50 51 52 53 54 55  | Next Page >