Hirdetés
- Samsung Galaxy S25 Ultra - titán keret, acélos teljesítmény
- Motorola Edge 40 - jó bőr
- Fotók, videók mobillal
- Google Pixel topik
- Hivatalos a OnePlus 13 startdátuma
- Samsung Galaxy Fit 3 - keveset, de jól
- Xiaomi 15 - kicsi telefon nagy energiával
- iPhone topik
- Apple AirPods Pro (2. generáció) - csiszolt almaságok
- Samsung Galaxy S24 Ultra - ha működik, ne változtass!
-
Mobilarena
JavaScript != Java (A JavaScript nem összekeverendő a Javával, két különböző programozási nyelvről van szó!)
Új hozzászólás Aktív témák
-
tildy
nagyúr
Sziasztok!
PHPban van foreach , az érdekelne, van-e erre valami megoldás javascriptben is.
PHP a kód nagy része, van benne egy tömb is ,a mit szeretnék használni :
vlahogy igy :
foreach ($matches[0] as $key=>$value)
{
$coordinata =preg_split(''/ \|\ /'',$matches[0][$key]);
//és ide lenne a javascript kód
$.html= <<<EOH
<script type=''text/javascript''>
var point = new GLatLng($coordinata[1], $coordinata[0]);
var marker = createMarker(point,'<div style=''width:240px''>Eov koordináták : <br/> x: $coordinata[1]<br/> y: $coordinata[0]</a> </div>')
map.addOverlay(marker);
</script>
EOH;
}
Na de nem tudom, hogy kéne ehhez átírnom ezt:
$html = <<< EOH
<div id=''map'' style=''width: 550px; height: 450px''></div>
<noscript><b>JavaScript must be enabled in order for you to use Google Maps.</b>
However, it seems JavaScript is either disabled or not supported by your browser.
To view Google Maps, enable JavaScript by changing your browser options, and then
try again.
</noscript>
<script type=''text/javascript''>
//<![CDATA[
if (GBrowserIsCompatible()) {
// A function to create the marker and set up the event window
// Dont try to unroll this function. It has to be here for the function closure
// Each instance of the function preserves the contends of a different instance
// of the ''marker'' and ''html'' variables which will be needed later when the event triggers.
function createMarker(point,html) {
var marker = new GMarker(point);
GEvent.addListener(marker, ''click'', function() {
marker.openInfoWindowHtml(html);
});
return marker;
}
// Display the map, with some controls and set the initial location
var map = new GMap2(document.getElementById(''map''));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng($eovwgs[1], $eovwgs[0]),8);
// Set up three markers with info windows
var point = new GLatLng($eovwgs[1], $eovwgs[0]);
var marker = createMarker(point,'<div style=''width:240px''>Eov koordináták : <br/> x: $eov_x <br/> y: $eov_y </a> </div>')
map.addOverlay(marker);
}
// display a warning if the browser was not compatible
else {
alert(''Sorry, the Google Maps API is not compatible with this browser'');
}
//]]>
</script>
EOH;
Új hozzászólás Aktív témák
- f(x)=exp(x): A laposföld elmebaj: Vissza a jövőbe!
- Milyen videókártyát?
- Milyen TV-t vegyek?
- XPEnology
- PlayStation 5
- exHWSW - Értünk mindenhez IS
- Samsung Galaxy S25 Ultra - titán keret, acélos teljesítmény
- Windows 11
- Elektromos autók - motorok
- Telekom otthoni szolgáltatások (TV, internet, telefon)
- További aktív témák...
- ZBook Fury 16 G10 16" FHD+ IPS i7-13850HX RTX 3500 Ada 32GB 1TB NVMe ujjlolv gar
- ASUS ROG Strix G15
- X1 Yoga 8th 14" FHD+ IPS érintő i5-1335U 16GB 256GB magyarított vbill aktív toll ujjlolv IR kam gar
- Dell Precision 3570 15.6" FHD IPS i7-1270P 32GB 512GB NVMe gar
- Apple watch Ultra 2 2026.08.19. Apple jótállás
- AKCIÓ! Lenovo Thinkpad T14 Gen 5 üzleti - Ultra 7 165U 16GB DDR5 512GB SSD Intel Graphics WIN11
- DELL Precision 5540 Workstation i7-9850H Nvidia Quadro T1000 32GB 1000GB 15.6 új akksi 1év garancia
- BESZÁMÍTÁS! GigaByte H610M i5 14400F 16GB DDR4 512GB SSD RTX 3060 Ti 8GB Kolink Observatory RGB 800W
- Epson Workforce DS-530II dokumentumszkenner
- Surface Laptop 7 Business edition - Intel Core ultra 5 236V energiahatékonyabb az intelnél! -olvass
Állásajánlatok
Cég: CAMERA-PRO Hungary Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest