JavaScript - Problema al pasar url imagen por parametro

 
Vista:
Imágen de perfil de baldric

Problema al pasar url imagen por parametro

Publicado por baldric (1 intervención) el 02/07/2017 17:15:08
Hola,
estoy haciendo un codigo con php, el cual tiene ciertas funciones en javascript.

Mi problema radica en pasar la dirección de una imagen "externa", se genera a posteriori
y se guarda en una web de Creative (estoy usando su sdk), para que la pueda imprimir mediante un boton.


Se supone que esta funcion hace que el sdk de creative guarde la imagen en su propia web i
la guarda en image.src (si no estoy muy equivocado)

1
2
3
4
5
onSave: function(imageID, newURL) {
		image = document.getElementById(imageID);
		image.src = newURL;
                featherEditor.close();
	},


Y necesito que este codigo recoja la url de dicha imagen y la pase a mi archivo executar1.php
Basicamente aqui es donde estoy encalladisimo. no se como sacar la ruta.

1
2
<td width="25%" height="100%">
<form method="POST" action= "http://localhost/creative/executar1.php/?fotoPer=' <script type='text/javascript'> return getElementById(image1).src;</script>' " name="ImprimirPersonal'">


Codigo original


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<?php
    include 'Idioma.php';
   $titleCat ='';
   $fotoeditar = $_GET['etiqueta'];
 
?>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html lang="en-US">
<head>
 
<meta charset="utf-8">
        <link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Merriweather:400,700&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
        <link rel="stylesheet" href="demo/normalize.css">
        <link rel="stylesheet" href="demo/bagpakk.min.css">
        <link rel="stylesheet" href="demo/style.css">
        <link rel="stylesheet" href="src/css/swipebox.css">
        <style type="text/css">
        body,td,th {
	font-family: Merriweather, serif;
	font-size: 18px;
}
body {
	background-color: #373635;
}
        </style>
        <title><?php echo $editar; ?></title>
        <!-- share buttons -->
        <!-- end share buttons -->
 
  <!-- Load Feather code -->
 
<script type="text/javascript" src="http://localhost/creative/editor.js"></script>
 
 
<!-- Instantiate Feather -->
<script type='text/javascript'>
var image;
var featherEditor = new Aviary.Feather({
	apiKey: '1723c83d046c9b2',
	theme: 'dark', // Check out our new 'light' and 'dark' themes!
	tools: 'text',
	initTool:'text',
	appendTo: '',
	language:'es',
	onSave: function(imageID, newURL) {
		image = document.getElementById(imageID);
		image.src = newURL;
                featherEditor.close();
	},
	onError: function(errorObj) {
		alert(errorObj.message);
	}
});
function launchEditor(id, src) {
	featherEditor.launch({
		image: id,
		url: src
	});
	return false;
 
 
}
 
</script>
 
 
 
</head>
 
<body>
 
<!-- obtenim idioma pag anterior -->
 
 
<!-- obtenim idioma pag anterior final -->
 
 
<div id='injection_site' ></div>
<!-- Add an edit button, passing the HTML id of the image and the public URL of the image -->
<div align='center'>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="5%"  >
<tr align="center">
 
<td width="25%" height="100%">
<form>
 
<p><input type="button"  style="background-color:#112A90; border: none; color: white; padding: 15px 25%; box-sizing: border-box; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; border-radius: 7px 7px 7px 7px;" name="b_editar"  value='Editar' onclick="return launchEditor('image1','<?php  echo $fotoeditar;?>')" /></p>
</form>
</td>
 
<td width="25%" height="100%">
 
<form method="POST" action="http://localhost/creative/executar.php/?fotoOri='<?php  echo $fotoeditar;?>'" >
  <p><input type="submit" value="Imprimir Original" name="rutaImage" style="background-color:#4CAF50; border: none; color: white; padding: 15px 25%; box-sizing: border-box; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; border-radius: 7px 7px 7px 7px;" /></p>
</form>
</td>
 
 
 
<td width="25%" height="100%">
<form method="POST" action= "http://localhost/creative/executar1.php/?fotoPer=' <script type='text/javascript'> return getElementById(image1).src;</script>' " name="ImprimirPersonal'">
  <p><input type="submit" value="Imprimir Personal" name="rutaImage" style="background-color:#4CAF50; border: none; color: white; padding: 15px 25%; box-sizing: border-box; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; border-radius: 7px 7px 7px 7px;" /></p>
</form>
</td>
 
 
<td width="25%" height="100%">
<form>
<input type="button" name="b_tancar" value='X' style="background-color:#4CAF50; float:right; border: none;color: white;padding: 15px 25%; box-sizing: border-box; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; border-radius: 7px 7px 7px 7px;"  onclick='history.back()'; />
</form>
</td>
 
</tr>
</table>
<br><br>
 
<div style="width: 95%;height: 90%;text-align: center;border-top-style: solid;
  border-right-style: solid;  border-bottom-style: solid;  border-left-style: solid; border-top: 2px solid grey;
  border-right: 2px solid grey;  border-bottom: 2px solid grey;  border-left: 2px solid grey;border-radius: 10px 10px 10px 10px;background:#8D8886;">
<div id="foto" align="center">
<br><br>
<img id='image1' src='<?php echo $fotoeditar ?>'/>
 
 
<br><br><br><br>
 
 
</div>
</div>
</div>
</body>
</html>

Si podeis ayudarme estar super agradecido.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder